Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 64 for assertFailsWith (0.25 sec)

  1. 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()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 13.2K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/HeadersTest.kt

      }
    
      @Test fun ofRejectsNullChar() {
        assertFailsWith<IllegalArgumentException> {
          headersOf("User-Agent", "Square\u0000OkHttp")
        }
      }
    
      @Test fun ofMapThrowsOnEmptyName() {
        assertFailsWith<IllegalArgumentException> {
          mapOf("" to "OkHttp").toHeaders()
        }
      }
    
      @Test fun ofMapThrowsOnBlankName() {
        assertFailsWith<IllegalArgumentException> {
          mapOf(" " to "OkHttp").toHeaders()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

    import assertk.fail
    import java.io.IOException
    import java.net.ServerSocket
    import java.net.Socket
    import java.net.SocketException
    import java.util.concurrent.TimeUnit
    import kotlin.test.assertFailsWith
    import okhttp3.DelegatingServerSocketFactory
    import okhttp3.DelegatingSocketFactory
    import okhttp3.OkHttpClient
    import okhttp3.OkHttpClientTestRule
    import okhttp3.Request
    import okhttp3.RequestBody
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  4. 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> {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  5. okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt

     */
    package okhttp3.coroutines
    
    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import assertk.assertions.isTrue
    import java.io.IOException
    import java.util.concurrent.TimeUnit
    import kotlin.test.assertFailsWith
    import kotlin.time.Duration.Companion.seconds
    import kotlinx.coroutines.CancellationException
    import kotlinx.coroutines.Dispatchers
    import kotlinx.coroutines.TimeoutCancellationException
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  6. 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 =
          """
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13.8K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

      }
    
      @Test fun closeCodeOutOfRangeThrows() {
        assertFailsWith<IllegalArgumentException> {
          clientWriter.writeClose(98724976, "Hello".encodeUtf8())
        }.also { expected ->
          assertThat(expected.message).isEqualTo("Code must be in range [1000,5000): 98724976")
        }
      }
    
      @Test fun closeReservedThrows() {
        assertFailsWith<IllegalArgumentException> {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  8. 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> {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  9. 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> {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 14.4K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/HeadersJvmTest.kt

      }
    
      @Test fun addThrowsOnEmptyName() {
        assertFailsWith<IllegalArgumentException> {
          Headers.Builder().add(": bar")
        }
        assertFailsWith<IllegalArgumentException> {
          Headers.Builder().add(" : bar")
        }
      }
    
      @Test fun addThrowsOnNoColon() {
        assertFailsWith<IllegalArgumentException> {
          Headers.Builder().add("foo bar")
        }
      }
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.6K bytes
    - Viewed (0)
Back to top