- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 49 for assertFailsWith (0.1 seconds)
-
okhttp/src/jvmTest/kotlin/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()
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Feb 03 22:17:59 GMT 2026 - 13.4K bytes - Click Count (1) -
okhttp/src/jvmTest/kotlin/okhttp3/TrailersTest.kt
assertThat(source.readUtf8(halfResponseBody.length.toLong())).isEqualTo(halfResponseBody) source.close() assertFailsWith<IllegalStateException> { source.readUtf8() } assertFailsWith<IOException> { response.peekTrailers() } assertFailsWith<IOException> { response.trailers() } } } private fun MockResponse.Builder.body(
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Jan 27 09:00:39 GMT 2026 - 18.8K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/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> {
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Nov 04 16:11:23 GMT 2025 - 14.4K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/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) } }
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Feb 03 22:17:59 GMT 2026 - 11K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/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") } }
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue May 27 14:51:25 GMT 2025 - 5.7K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/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 mockwebserver3.junit5.StartStop import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.TestUtil.repeat
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Jun 18 12:28:21 GMT 2025 - 10.6K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/CallLimitsTest.kt
* limitations under the License. */ package okhttp3 import app.cash.burst.Burst import app.cash.burst.burstValues import java.io.IOException import java.util.Random import kotlin.test.assertFailsWith import mockwebserver3.MockResponse import mockwebserver3.MockWebServer import mockwebserver3.junit5.StartStop import okhttp3.testing.PlatformRule import okio.ByteString.Companion.toByteString
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Mar 15 09:02:18 GMT 2026 - 3.5K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt
import java.util.concurrent.SynchronousQueue import java.util.concurrent.ThreadPoolExecutor import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicReference import kotlin.test.assertFailsWith import mockwebserver3.MockResponse import mockwebserver3.MockWebServer import mockwebserver3.SocketEffect.ShutdownConnection import mockwebserver3.junit5.StartStop import okhttp3.MediaType.Companion.toMediaType
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Nov 04 16:11:23 GMT 2025 - 28.2K bytes - Click Count (0) -
mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt
@Test fun cannotAccessAddressBeforeStart() { val other = MockWebServer() assertFailsWith<IllegalStateException> { other.socketAddress } assertFailsWith<IllegalStateException> { other.hostName } assertFailsWith<IllegalStateException> { other.port } assertFailsWith<IllegalStateException> { other.proxyAddress } other.use {
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Sun Aug 03 22:38:00 GMT 2025 - 28K bytes - Click Count (0) -
okhttp/src/jvmTest/kotlin/okhttp3/internal/cache/DiskLruCacheTest.kt
private fun Editor.assertInoperable() { assertFailsWith<IllegalStateException> { setString(0, "A") } assertFailsWith<IllegalStateException> { newSource(0) } assertFailsWith<IllegalStateException> { newSink(0) } assertFailsWith<IllegalStateException> { commit() } assertFailsWith<IllegalStateException> { abort() }
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Tue Feb 03 22:17:59 GMT 2026 - 59.4K bytes - Click Count (0)