Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 94 for mockwebserver (0.2 sec)

  1. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockWebServer.kt

    import javax.net.ssl.SSLSocketFactory
    import okhttp3.ExperimentalOkHttpApi
    import okhttp3.HttpUrl
    import okhttp3.Protocol
    import org.junit.rules.ExternalResource
    
    class MockWebServer : ExternalResource(), Closeable {
      @ExperimentalOkHttpApi
      val delegate = mockwebserver3.MockWebServer()
    
      val requestCount: Int by delegate::requestCount
    
      var bodyLimit: Long by delegate::bodyLimit
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Tue Jan 23 14:31:42 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  2. 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:
    
    ```
    testRuntimeOnly("com.squareup.okhttp3:mockwebserver3-junit5:4.12.0")
    ```
    
    Then in tests annotated `@org.junit.jupiter.api.Test`, you may add a [MockWebServer] as a test
    method parameter. It will be shut down automatically after the test runs.
    
    ```
    class MyTest {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Jan 14 10:20:09 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  3. mockwebserver/src/test/java/mockwebserver3/CustomDispatcherTest.kt

    import org.junit.jupiter.api.Test
    import org.junit.jupiter.api.Timeout
    
    @Timeout(30)
    class CustomDispatcherTest {
      private lateinit var mockWebServer: MockWebServer
    
      @BeforeEach
      fun setUp(mockWebServer: MockWebServer) {
        this.mockWebServer = mockWebServer
      }
    
      @Test
      fun simpleDispatch() {
        val requestsMade = mutableListOf<RecordedRequest>()
        val dispatcher: Dispatcher =
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  4. 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.dispatcher
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  5. samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java

    import java.util.LinkedHashMap;
    import java.util.Map;
    import okhttp3.HttpUrl;
    import okhttp3.mockwebserver.Dispatcher;
    import okhttp3.mockwebserver.MockResponse;
    import okhttp3.mockwebserver.MockWebServer;
    import okhttp3.mockwebserver.RecordedRequest;
    import okio.ByteString;
    
    /**
     * Runs a MockWebServer on localhost and uses it as the backend to receive an OAuth session.
     *
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Aug 12 07:26:27 UTC 2021
    - 3.8K bytes
    - Viewed (0)
  6. 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:4.12.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 Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Dec 17 15:34:10 UTC 2023
    - 707 bytes
    - Viewed (0)
  7. settings.gradle.kts

    }
    
    include(":mockwebserver")
    project(":mockwebserver").name = "mockwebserver3"
    include(":mockwebserver-deprecated")
    project(":mockwebserver-deprecated").name = "mockwebserver"
    include(":mockwebserver-junit4")
    project(":mockwebserver-junit4").name = "mockwebserver3-junit4"
    include(":mockwebserver-junit5")
    project(":mockwebserver-junit5").name = "mockwebserver3-junit5"
    
    val androidBuild: String by settings
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Apr 14 14:24:05 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/LoomTest.kt

    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import assertk.assertions.isTrue
    import java.util.concurrent.ExecutorService
    import java.util.concurrent.Executors
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import okhttp3.testing.PlatformRule
    import org.junit.jupiter.api.BeforeEach
    import org.junit.jupiter.api.Test
    import org.junit.jupiter.api.extension.RegisterExtension
    
    class LoomTest {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2K bytes
    - Viewed (0)
  9. mockwebserver-junit5/src/test/java/mockwebserver3/junit5/internal/ExtensionMultipleInstancesTest.kt

      var defaultInstancePort: Int = -1
      var instanceAPort: Int = -1
      var instanceBPort: Int = -1
    
      @BeforeEach
      fun setup(
        defaultInstance: MockWebServer,
        @MockWebServerInstance("A") instanceA: MockWebServer,
        @MockWebServerInstance("B") instanceB: MockWebServer,
      ) {
        defaultInstancePort = defaultInstance.port
        instanceAPort = instanceA.port
        instanceBPort = instanceB.port
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Jan 14 10:20:09 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  10. mockwebserver-junit4/api/mockwebserver3-junit4.api

    public final class mockwebserver3/junit4/MockWebServerRule : org/junit/rules/ExternalResource {
    	public static final field Companion Lmockwebserver3/junit4/MockWebServerRule$Companion;
    	public fun <init> ()V
    	public final fun getServer ()Lmockwebserver3/MockWebServer;
    }
    
    public final class mockwebserver3/junit4/MockWebServerRule$Companion {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Feb 26 19:17:33 UTC 2022
    - 346 bytes
    - Viewed (0)
Back to top