Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 32 for assertFailsWith (0.18 sec)

  1. okhttp/src/test/java/okhttp3/CertificatePinnerTest.kt

            .build()
    
        // Should be pinned:
        assertFailsWith<SSLPeerUnverifiedException> {
          certificatePinner.check("example.co.uk", listOf(certB1.certificate))
        }
        assertFailsWith<SSLPeerUnverifiedException> {
          certificatePinner.check("foo.example.co.uk", listOf(certB1.certificate))
        }
        assertFailsWith<SSLPeerUnverifiedException> {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  2. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

        val bytes = "170d3139313231362333303231305a".decodeHex()
        assertFailsWith<ProtocolException> {
          Adapters.UTC_TIME.fromDer(bytes)
        }.also { expected ->
          assertThat(expected).hasMessage("Failed to parse UTCTime 191216#30210Z")
        }
      }
    
      @Test fun `cannot decode generalized time with offset`() {
        assertFailsWith<ProtocolException> {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 31.7K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/MultipartReaderTest.kt

            boundary = "simple boundary",
            source = Buffer().writeUtf8(multipart),
          )
    
        val part = parts.nextPart()!!
        assertFailsWith<EOFException> {
          assertThat(part.body.readUtf8()).isEqualTo("abcd\r\nefgh\r\n")
        }
    
        assertFailsWith<EOFException> {
          assertThat(parts.nextPart()).isNull()
        }
      }
    
      @Test fun `malformed headers`() {
        val multipart =
          """
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/ws/WebSocketReaderTest.kt

        data.write("0a00".decodeHex()) // Empty pong.
        assertFailsWith<ProtocolException> {
          clientReader.processNextFrame()
        }.also { expected ->
          assertThat(expected.message)
            .isEqualTo("Control frames must be final.")
        }
      }
    
      @Test fun reservedFlag1IsUnsupportedWithNoCompression() {
        data.write("ca00".decodeHex()) // Empty pong, flag 1 set.
        assertFailsWith<ProtocolException> {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 14.4K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/OkHttpClientTest.kt

        builder.networkInterceptors().addAll(listOf(null) as List<Interceptor>)
        assertFailsWith<IllegalStateException> {
          builder.build()
        }.also { expected ->
          assertThat(expected.message).isEqualTo("Null network interceptor: [null]")
        }
      }
    
      @Test fun testH2PriorKnowledgeOkHttpClientConstructionFallback() {
        assertFailsWith<IllegalArgumentException> {
          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)
  6. okhttp/src/test/java/okhttp3/RequestTest.kt

        val builder = Request.Builder()
        assertFailsWith<IllegalArgumentException> {
          builder.header(s, "Value")
        }
        assertFailsWith<IllegalArgumentException> {
          builder.addHeader(s, "Value")
        }
        assertFailsWith<IllegalArgumentException> {
          builder.header("Name", s)
        }
        assertFailsWith<IllegalArgumentException> {
          builder.addHeader("Name", s)
        }
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/ResponseBodyJvmTest.kt

    import assertk.assertions.isTrue
    import java.io.IOException
    import java.io.InputStreamReader
    import java.io.Reader
    import java.nio.charset.StandardCharsets
    import java.util.concurrent.atomic.AtomicBoolean
    import kotlin.test.assertFailsWith
    import okhttp3.MediaType.Companion.toMediaType
    import okhttp3.ResponseBody.Companion.toResponseBody
    import okhttp3.internal.and
    import okio.Buffer
    import okio.BufferedSource
    import okio.ByteString
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon May 13 13:42:37 UTC 2024
    - 13K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/RequestCommonTest.kt

        val builder = Request.Builder()
        assertFailsWith<IllegalArgumentException> {
          builder.header(s, "Value")
        }
        assertFailsWith<IllegalArgumentException> {
          builder.addHeader(s, "Value")
        }
        assertFailsWith<IllegalArgumentException> {
          builder.header("Name", s)
        }
        assertFailsWith<IllegalArgumentException> {
          builder.addHeader("Name", s)
        }
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/DuplexTest.kt

    import java.util.concurrent.BlockingQueue
    import java.util.concurrent.CountDownLatch
    import java.util.concurrent.Executors
    import java.util.concurrent.LinkedBlockingQueue
    import java.util.concurrent.TimeUnit
    import kotlin.test.assertFailsWith
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import mockwebserver3.internal.duplex.MockStreamHandler
    import okhttp3.Credentials.basic
    import okhttp3.Headers.Companion.headersOf
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.kt

    import java.net.HttpURLConnection
    import java.time.Duration
    import java.util.concurrent.CountDownLatch
    import java.util.concurrent.TimeUnit
    import java.util.concurrent.atomic.AtomicReference
    import kotlin.test.assertFailsWith
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import okhttp3.MediaType.Companion.toMediaTypeOrNull
    import okhttp3.TestUtil.repeat
    import okhttp3.testing.Flaky
    import okio.BufferedSink
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 10.5K bytes
    - Viewed (0)
Back to top