- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 77 for MockResponse (0.12 sec)
-
okhttp/src/test/java/okhttp3/InterceptorTest.kt
"network interceptor $interceptor must call proceed() exactly once", ) } } @Test fun networkInterceptorsCannotCallProceedMultipleTimes() { server.enqueue(MockResponse()) server.enqueue(MockResponse()) val interceptor = Interceptor { chain: Interceptor.Chain -> chain.proceed(chain.request()) chain.proceed(chain.request()) } client =
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Jan 14 10:20:09 UTC 2024 - 27.8K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/HttpsServer.java
*/ package okhttp3.recipes; import java.net.InetAddress; import okhttp3.Call; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.tls.HandshakeCertificates; import okhttp3.tls.HeldCertificate; /** * Create an HTTPS server with a self-signed certificate that OkHttp trusts. */
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 02 14:04:37 UTC 2023 - 2.1K bytes - Viewed (0) -
mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/DeprecationBridge.kt
return delegate.dispatch(request.unwrap()).wrap() } override fun peek(): mockwebserver3.MockResponse { return delegate.peek().wrap() } override fun shutdown() { delegate.shutdown() } } } internal fun MockResponse.wrap(): mockwebserver3.MockResponse { val result = mockwebserver3.MockResponse.Builder()
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 4.6K bytes - Viewed (0) -
okhttp-logging-interceptor/src/test/java/okhttp3/logging/HttpLoggingInterceptorTest.kt
} } @Test fun none() { server.enqueue(MockResponse()) client.newCall(request().build()).execute() applicationLogs.assertNoMoreLogs() networkLogs.assertNoMoreLogs() } @Test fun basicGet() { setLevel(Level.BASIC) server.enqueue(MockResponse()) client.newCall(request().build()).execute() applicationLogs
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Apr 06 09:14:38 UTC 2024 - 37.6K bytes - Viewed (0) -
okhttp-logging-interceptor/src/test/java/okhttp3/logging/LoggingEventListenerTest.kt
*/ package okhttp3.logging import assertk.assertThat import assertk.assertions.isNotNull import java.io.IOException import java.net.UnknownHostException import java.util.Arrays import mockwebserver3.MockResponse import mockwebserver3.MockWebServer import mockwebserver3.SocketPolicy.FailHandshake import okhttp3.HttpUrl import okhttp3.MediaType.Companion.toMediaType import okhttp3.OkHttpClient import okhttp3.OkHttpClientTestRule
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sun Jan 14 10:20:09 UTC 2024 - 10.2K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/CacheCorruptionTest.kt
server.enqueue( MockResponse( headers = headersOf( "Last-Modified", formatDate(-1, TimeUnit.HOURS)!!, "Expires", formatDate(1, TimeUnit.HOURS)!!, ), body = "ABC.1", ), ) server.enqueue( MockResponse( headers = headersOf(
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 20 10:30:28 UTC 2024 - 6K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/http/CancelTest.kt
setUp(mode) val responseBodySize = 8 * 1024 * 1024 // 8 MiB. server.enqueue( MockResponse.Builder() .body( Buffer() .write(ByteArray(responseBodySize)), ) .throttleBody(64 * 1024, 125, MILLISECONDS) // 500 Kbps .build(), ) server.enqueue(MockResponse(body = ".")) val call = client.newCall(Request.Builder().url(server.url("/")).build())
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 20 10:30:28 UTC 2024 - 9.9K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/KotlinDeprecationErrorTest.kt
} @Test @Disabled fun mockResponse() { val mockResponse = MockResponse() var status: String = mockResponse.getStatus() var headers: Headers = mockResponse.getHeaders() var trailers: Headers = mockResponse.getTrailers() var socketPolicy: SocketPolicy = mockResponse.getSocketPolicy() var http2ErrorCode: Int = mockResponse.getHttp2ErrorCode() } @Test @Disabled
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 13.3K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt
import okhttp3.DelegatingSocketFactory import okhttp3.OkHttpClient import okhttp3.OkHttpClientTestRule import okhttp3.Request import okhttp3.RequestBody import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import okhttp3.testing.PlatformRule import okio.Buffer import okio.BufferedSink import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 4.6K bytes - Viewed (0) -
mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/PushPromise.kt
import okhttp3.Headers class PushPromise( @get:JvmName("method") val method: String, @get:JvmName("path") val path: String, @get:JvmName("headers") val headers: Headers, @get:JvmName("response") val response: MockResponse, ) { @JvmName("-deprecated_method") @Deprecated( message = "moved to val", replaceWith = ReplaceWith(expression = "method"), level = DeprecationLevel.ERROR, ) fun method(): String = method
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Mon Jan 08 01:13:22 UTC 2024 - 1.7K bytes - Viewed (0)