- Sort Score
- Num 10 results
- Language All
Results 11 - 20 of 148 for mockwebserver (0.2 seconds)
-
mockwebserver-junit4/README.md
MockWebServer for JUnit 4 ========================= This module integrates mockwebserver3.MockWebServer with JUnit 4. To use, first add this library as a test dependency: ``` testImplementation("com.squareup.okhttp3:mockwebserver3-junit4:5.3.0") ``` Then in tests annotated `@org.junit.Test`, you may declare a field with the `@Rule` annotation: ``` @Rule public final MockWebServerRule serverRule = new MockWebServerRule(); ```Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Thu Oct 30 21:39:59 GMT 2025 - 706 bytes - Click Count (0) -
mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt
var requestCount: Int = mockWebServer.requestCount mockWebServer.enqueue(MockResponse()) mockWebServer.start() mockWebServer.start(0) mockWebServer.start(InetAddress.getLocalHost(), 0) mockWebServer.shutdown() var dispatcher: Dispatcher = mockWebServer.dispatcher dispatcher = mockWebServer.dispatcherCreated: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Mon Jan 08 01:13:22 GMT 2024 - 7.3K bytes - Click Count (0) -
mockwebserver-junit4/src/main/kotlin/mockwebserver3/junit4/MockWebServerRule.kt
* See the License for the specific language governing permissions and * limitations under the License. */ package mockwebserver3.junit4 import java.io.IOException import mockwebserver3.MockWebServer import org.junit.rules.ExternalResource /** * Runs MockWebServer for the duration of a single test method. * * In Java JUnit 4 tests (ie. tests annotated `@org.junit.Test`), use this by defining a field with
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Mon Jun 16 22:36:18 GMT 2025 - 1.4K bytes - Click Count (0) -
mockwebserver/README.md
### Example Use MockWebServer the same way that you use mocking frameworks like [Mockito](https://github.com/mockito/mockito): 1. Script the mocks. 2. Run application code. 3. Verify that the expected requests were made. Here's a complete example: ### Java ```java public void test() throws Exception { // Create a MockWebServer. These are lean enough that you can create a new
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Thu Oct 30 21:39:59 GMT 2025 - 8.1K bytes - Click Count (0) -
samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/ClientAndServer.java
import java.util.Collections; import okhttp3.OkHttpClient; import okhttp3.Protocol; import okhttp3.Request; import okhttp3.Response; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; /** * Create UNIX domain sockets for MockWebServer and OkHttp and connect 'em together. Note that we * cannot do TLS over domain sockets. */ public class ClientAndServer { public void run() throws Exception {
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Mon Dec 24 03:46:30 GMT 2018 - 2.1K bytes - Click Count (0) -
mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt
} } @Test fun toStringIncludesLifecycleState() { val other = MockWebServer() assertThat(other.toString()).isEqualTo("MockWebServer{new}") other.use { other.start() assertThat(other.toString()).isEqualTo("MockWebServer{port=${other.port}}") } assertThat(other.toString()).isEqualTo("MockWebServer{closed}") } @Test fun closeWhileBlockedDispatching() {
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Aug 03 22:38:00 GMT 2025 - 28K bytes - Click Count (0) -
module-tests/src/test/java/okhttp3/modules/test/JavaModuleTest.java
* See the License for the specific language governing permissions and * limitations under the License. */ package okhttp3.modules.test; import mockwebserver3.MockResponse; import mockwebserver3.MockWebServer; import okhttp3.Call; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Response; import okhttp3.logging.HttpLoggingInterceptor;
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Sep 21 06:22:22 GMT 2025 - 2.1K bytes - Click Count (0) -
mockwebserver/src/test/java/mockwebserver3/CustomDispatcherTest.kt
@Timeout(30) class CustomDispatcherTest { @StartStop private val mockWebServer = MockWebServer() @Test fun simpleDispatch() { val requestsMade = mutableListOf<RecordedRequest>() val dispatcher: Dispatcher = object : Dispatcher() { override fun dispatch(request: RecordedRequest): MockResponse { requestsMade.add(request) return MockResponse() } }Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Jun 18 12:28:21 GMT 2025 - 3.2K bytes - Click Count (1) -
mockwebserver-junit5/src/main/kotlin/mockwebserver3/junit5/internal/StartStopExtension.kt
* See the License for the specific language governing permissions and * limitations under the License. */ package mockwebserver3.junit5.internal import java.lang.reflect.Modifier import mockwebserver3.MockWebServer import mockwebserver3.junit5.StartStop import okhttp3.internal.SuppressSignatureCheck import org.junit.jupiter.api.extension.BeforeAllCallback
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Feb 03 22:17:59 GMT 2026 - 2.4K bytes - Click Count (0) -
mockwebserver-deprecated/src/main/java9/module-info.java
@SuppressWarnings("module") module okhttp3.mockwebserver { requires okhttp3; exports okhttp3.mockwebserver; requires java.logging;Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Sep 21 06:22:22 GMT 2025 - 139 bytes - Click Count (0)