Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 77 for MockResponse (0.13 sec)

  1. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/ClientAndServer.java

    package okhttp3.unixdomainsockets;
    
    import java.io.File;
    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.
     */
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Dec 24 03:46:30 UTC 2018
    - 2.1K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/SessionReuseTest.kt

                  }
                },
              ),
            )
            .sslSocketFactory(sslSocketFactory, handshakeCertificates.trustManager)
            .build()
    
        server.enqueue(MockResponse(body = "abc1"))
        server.enqueue(MockResponse(body = "abc2"))
    
        val request = Request(server.url("/"))
    
        client.newCall(request).execute().use { response ->
          assertEquals(200, response.code)
        }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 6K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/SocketChannelTest.kt

    import javax.net.ssl.SNIHostName
    import javax.net.ssl.SNIMatcher
    import javax.net.ssl.SNIServerName
    import javax.net.ssl.SSLSocket
    import javax.net.ssl.StandardConstants
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import okhttp3.Protocol.HTTP_1_1
    import okhttp3.Protocol.HTTP_2
    import okhttp3.Provider.CONSCRYPT
    import okhttp3.Provider.JSSE
    import okhttp3.TlsExtensionMode.DISABLED
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 8K bytes
    - Viewed (0)
  4. samples/compare/src/test/kotlin/okhttp3/compare/ApacheHttpClientTest.kt

     * limitations under the License.
     */
    package okhttp3.compare
    
    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import assertk.assertions.startsWith
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import org.apache.hc.client5.http.classic.methods.HttpGet
    import org.apache.hc.client5.http.impl.classic.HttpClients
    import org.apache.hc.core5.http.io.entity.EntityUtils
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  5. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

       * so on.
       *
       * @throws ClassCastException if the default dispatcher has been
       * replaced with [setDispatcher][dispatcher].
       */
      fun enqueue(response: MockResponse) = (dispatcher as QueueDispatcher).enqueueResponse(response)
    
      /**
       * Starts the server on the loopback interface for the given port.
       *
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Mar 31 17:16:15 UTC 2024
    - 37.4K bytes
    - Viewed (0)
  6. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

    import assertk.assertions.isNotEmpty
    import assertk.assertions.isNull
    import assertk.fail
    import java.net.InetAddress
    import java.net.UnknownHostException
    import java.util.concurrent.CountDownLatch
    import mockwebserver3.MockResponse
    import mockwebserver3.junit4.MockWebServerRule
    import okhttp3.AsyncDns
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.tls.HandshakeCertificates
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  7. mockwebserver-junit5/src/test/java/mockwebserver3/junit5/internal/ExtensionLifecycleTest.kt

    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import assertk.assertions.isNotSameInstanceAs
    import assertk.assertions.isSameInstanceAs
    import assertk.assertions.isTrue
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import okhttp3.OkHttpClientTestRule
    import okhttp3.Request
    import org.junit.jupiter.api.AfterAll
    import org.junit.jupiter.api.AfterEach
    import org.junit.jupiter.api.BeforeAll
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Feb 11 12:12:36 UTC 2024
    - 3K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/JSSETest.kt

    import assertk.assertions.containsExactly
    import assertk.assertions.isEqualTo
    import assertk.assertions.isNotEmpty
    import javax.net.ssl.SSLSocket
    import javax.net.ssl.SSLSocketFactory
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import okhttp3.TestUtil.assumeNetwork
    import okhttp3.internal.connection
    import okhttp3.testing.PlatformRule
    import okhttp3.testing.PlatformVersion
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  9. okhttp-dnsoverhttps/src/test/java/okhttp3/dnsoverhttps/DnsOverHttpsTest.kt

        assertThat(recordedRequest.path)
          .isEqualTo("/lookup?ct&dns=AAABAAABAAAAAAAABmdvb2dsZQNjb20AAAEAAQ")
      }
    
      private fun dnsResponse(s: String): MockResponse {
        return MockResponse.Builder()
          .body(Buffer().write(s.decodeHex()))
          .addHeader("content-type", "application/dns-message")
          .addHeader("content-length", s.length / 2)
          .build()
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Apr 10 19:46:48 UTC 2024
    - 11K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/CallHandshakeTest.kt

     * limitations under the License.
     */
    package okhttp3
    
    import assertk.assertThat
    import assertk.assertions.containsExactly
    import assertk.assertions.isIn
    import javax.net.ssl.SSLSocket
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import okhttp3.CipherSuite.Companion.TLS_AES_128_GCM_SHA256
    import okhttp3.CipherSuite.Companion.TLS_AES_256_GCM_SHA384
    import okhttp3.CipherSuite.Companion.TLS_CHACHA20_POLY1305_SHA256
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 11.2K bytes
    - Viewed (0)
Back to top