Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for newClient (0.11 sec)

  1. native-image-tests/src/main/kotlin/okhttp3/SampleTest.kt

        server.enqueue(MockResponse(body = "abc"))
    
        val client = clientRule.newClient()
    
        client.newCall(Request(url = server.url("/"))).execute().use {
          assertThat(it.body.string()).isEqualTo("abc")
        }
      }
    
      @Test
      fun testExternalSite() {
        val client = clientRule.newClient()
    
        client.newCall(Request(url = "https://google.com/robots.txt".toHttpUrl())).execute().use {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/OkHttpClientTest.kt

          builder.protocols(listOf(Protocol.HTTP_1_0, Protocol.HTTP_1_1))
        }
      }
    
      @Test fun certificatePinnerEquality() {
        val clientA = clientTestRule.newClient()
        val clientB = clientTestRule.newClient()
        assertThat(clientB.certificatePinner).isEqualTo(clientA.certificatePinner)
      }
    
      @Test fun nullInterceptorInList() {
        val builder = OkHttpClient.Builder()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Mar 31 17:16:15 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  3. internal/dsync/dsync-client_test.go

    type ReconnectRESTClient struct {
    	u    *url.URL
    	rest *rest.Client
    }
    
    // newClient constructs a ReconnectRESTClient object with addr and endpoint initialized.
    // It _doesn't_ connect to the remote endpoint. See Call method to see when the
    // connect happens.
    func newClient(endpoint string) NetLocker {
    	u, err := url.Parse(endpoint)
    	if err != nil {
    		panic(err)
    	}
    
    	tr := &http.Transport{
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Jan 20 17:36:09 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  4. cmd/warm-backend-azure.go

    		return errors.New("no authentication mechanism was provided")
    	}
    
    	if conf.Bucket == "" {
    		return errors.New("no bucket name was provided")
    	}
    
    	return nil
    }
    
    func (conf azureConf) NewClient() (clnt *azblob.Client, clntErr error) {
    	if err := conf.Validate(); err != nil {
    		return nil, err
    	}
    
    	ep := conf.Endpoint
    	if ep == "" {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Oct 31 22:10:24 UTC 2024
    - 7K bytes
    - Viewed (0)
  5. mockwebserver-junit5/src/test/java/mockwebserver3/junit5/internal/ExtensionLifecycleTest.kt

        assertThat(server).isSameInstanceAs(instanceServer)
    
        clientTestRule.newClient().newCall(Request(server.url("/"))).execute().use {
          assertThat(it.code).isEqualTo(200)
        }
      }
    
      @Test
      fun testClient2(server: MockWebServer) {
        assertThat(server).isSameInstanceAs(instanceServer)
    
        clientTestRule.newClient().newCall(Request(server.url("/"))).execute().use {
          assertThat(it.code).isEqualTo(200)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Feb 11 12:12:36 UTC 2024
    - 3K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpClientTestRule.kt

    import org.junit.jupiter.api.extension.ExtensionContext
    
    /**
     * Apply this rule to all tests. It adds additional checks for leaked resources and uncaught
     * exceptions.
     *
     * Use [newClient] as a factory for a OkHttpClient instances. These instances are specifically
     * configured for testing.
     */
    class OkHttpClientTestRule : BeforeEachCallback, AfterEachCallback {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/CorrettoTest.kt

    class CorrettoTest {
      @JvmField @RegisterExtension
      val platform = PlatformRule()
    
      @JvmField @RegisterExtension
      val clientTestRule = OkHttpClientTestRule()
    
      private val client = clientTestRule.newClient()
    
      @BeforeEach fun setUp() {
        platform.assumeCorretto()
      }
    
      @Test
      @Disabled
      fun testMozilla() {
        assumeNetwork()
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/BouncyCastleTest.kt

    class BouncyCastleTest {
      @JvmField @RegisterExtension
      var platform = PlatformRule()
    
      @JvmField @RegisterExtension
      val clientTestRule = OkHttpClientTestRule()
      var client = clientTestRule.newClient()
      private lateinit var server: MockWebServer
    
      @BeforeEach
      fun setUp(server: MockWebServer) {
        this.server = server
        OkHttpDebugLogging.enable("org.bouncycastle.jsse")
        platform.assumeBouncyCastle()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/connection/RetryConnectionTest.kt

      private val retryableException = SSLHandshakeException("Simulated handshake exception")
    
      @RegisterExtension
      val clientTestRule = OkHttpClientTestRule()
    
      private var client = clientTestRule.newClient()
    
      @AfterEach internal fun tearDown() {
        factory.close()
      }
    
      @Test fun nonRetryableIOException() {
        val exception = IOException("Non-handshake exception")
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/OpenJSSETest.kt

    class OpenJSSETest {
      @JvmField @RegisterExtension
      var platform = PlatformRule()
    
      @JvmField @RegisterExtension
      val clientTestRule = OkHttpClientTestRule()
    
      var client = clientTestRule.newClient()
    
      private lateinit var server: MockWebServer
    
      @BeforeEach
      fun setUp(server: MockWebServer) {
        this.server = server
        platform.assumeOpenJSSE()
      }
    
      @Test
      fun testTlsv13Works() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 3.7K bytes
    - Viewed (0)
Back to top