- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 113 for mockWebServer (0.07 sec)
-
mockwebserver/src/test/java/mockwebserver3/CustomDispatcherTest.kt
import mockwebserver3.junit5.StartStop import org.junit.jupiter.api.Test import org.junit.jupiter.api.Timeout @Timeout(30) class CustomDispatcherTest { @StartStop private val mockWebServer = MockWebServer() @Test fun simpleDispatch() { val requestsMade = mutableListOf<RecordedRequest>() val dispatcher: Dispatcher = object : Dispatcher() {Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Jun 18 12:28:21 UTC 2025 - 3.2K bytes - Viewed (1) -
mockwebserver-junit5/src/main/kotlin/mockwebserver3/junit5/StartStop.kt
import org.junit.jupiter.api.extension.ExtendWith /** * Runs MockWebServer for the duration of a test method or test class. * * In Java JUnit 5 tests (ie. tests annotated `@org.junit.jupiter.api.Test`), use this by defining a * field with the `@StartStop` annotation: * * ```java * @StartStop public final MockWebServer server = new MockWebServer(); * ``` * * Or for Kotlin: * * ```kotlin
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Thu Jun 19 11:44:16 UTC 2025 - 1.3K bytes - Viewed (0) -
mockwebserver-junit5/README.md
MockWebServer for JUnit 5 ========================= This module integrates mockwebserver3.MockWebServer with JUnit 5. To use, first add this library as a test dependency: ``` testImplementation("com.squareup.okhttp3:mockwebserver3-junit5:5.3.0") ``` Annotate fields in test classes with `@StartStop`. The server will be started and shut down automatically. ``` class MyTest { @StartStopRegistered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Thu Oct 30 21:39:59 UTC 2025 - 665 bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/kt/DevServer.kt
import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import okhttp3.tls.HandshakeCertificates import okhttp3.tls.internal.TlsUtil class DevServer { val handshakeCertificates = TlsUtil.localhost() val server = MockWebServer().apply { useHttps(handshakeCertificates.sslSocketFactory(), false) enqueue(Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 1.9K bytes - Viewed (0) -
samples/static-server/src/main/java/okhttp3/sample/SampleServer.java
import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; import okhttp3.mockwebserver.Dispatcher; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; import okio.Buffer; import okio.Okio; public class SampleServer extends Dispatcher { private final SSLContext sslContext;Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Jan 02 02:50:44 UTC 2019 - 4.7K bytes - Viewed (0) -
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(); ```Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Thu Oct 30 21:39:59 UTC 2025 - 706 bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/http/ThreadInterruptTest.kt
import okhttp3.OkHttpClient import okhttp3.OkHttpClientTestRule import okhttp3.Request import okhttp3.RequestBody import okhttp3.Response import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import okhttp3.mockwebserver.SocketPolicy import okhttp3.testing.PlatformRule import okio.Buffer import okio.BufferedSink import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Tue Nov 04 18:33:48 UTC 2025 - 6.4K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/HttpsServer.java
*/ package okhttp3.recipes; import java.net.InetAddress; import okhttp3.Call; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.tls.HandshakeCertificates; import okhttp3.tls.HeldCertificate; /** * Create an HTTPS server with a self-signed certificate that OkHttp trusts. */
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Mon Jan 02 14:04:37 UTC 2023 - 2.1K bytes - Viewed (0) -
maven-tests/src/test/java/com/squareup/okhttp3/maventest/AppTest.java
import mockwebserver3.MockResponse; import mockwebserver3.MockWebServer; import okhttp3.Headers; import org.junit.Test; import java.io.IOException; /** * Unit test for simple App. */ public class AppTest { private final MockWebServer mockWebServer = new MockWebServer(); @Test public void testApp() throws IOException { mockWebServer.enqueue(new MockResponse(200, Headers.of(), "Hello, Maven!"));Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Sat Jul 12 12:05:57 UTC 2025 - 1.1K bytes - Viewed (0) -
mockwebserver-junit4/src/main/kotlin/mockwebserver3/junit4/MockWebServerRule.kt
* 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 * the `@Rule` annotation: *
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Mon Jun 16 22:36:18 UTC 2025 - 1.4K bytes - Viewed (0)