Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 20 of 112 for mockwebserver (0.05 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. samples/slack/src/main/java/okhttp3/slack/OAuthSessionFactory.java

    import java.util.LinkedHashMap;
    import java.util.Map;
    import okhttp3.HttpUrl;
    import okhttp3.mockwebserver.Dispatcher;
    import okhttp3.mockwebserver.MockResponse;
    import okhttp3.mockwebserver.MockWebServer;
    import okhttp3.mockwebserver.RecordedRequest;
    import okio.ByteString;
    
    /**
     * Runs a MockWebServer on localhost and uses it as the backend to receive an OAuth session.
     *
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Thu Aug 12 07:26:27 GMT 2021
    - 3.8K bytes
    - Click Count (1)
  2. mockwebserver-junit4/README.md

    MockWebServer for JUnit 4
    =========================
    
    This module integrates mockwebserver3.MockWebServer with JUnit 4.
    
    To use, first add this library as a test dependency:
    
    ```
    testImplementation("com.squareup.okhttp3:mockwebserver3-junit4:5.3.0")
    ```
    
    Then in tests annotated `@org.junit.Test`, you may declare a field with the `@Rule` annotation:
    
    ```
    @Rule public final MockWebServerRule serverRule = new MockWebServerRule();
    ```
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Thu Oct 30 21:39:59 GMT 2025
    - 706 bytes
    - Click Count (0)
  3. mockwebserver-junit4/src/main/kotlin/mockwebserver3/junit4/MockWebServerRule.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package mockwebserver3.junit4
    
    import java.io.IOException
    import mockwebserver3.MockWebServer
    import org.junit.rules.ExternalResource
    
    /**
     * Runs MockWebServer for the duration of a single test method.
     *
     * In Java JUnit 4 tests (ie. tests annotated `@org.junit.Test`), use this by defining a field with
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Mon Jun 16 22:36:18 GMT 2025
    - 1.4K bytes
    - Click Count (0)
  4. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

        var requestCount: Int = mockWebServer.requestCount
        mockWebServer.enqueue(MockResponse())
        mockWebServer.start()
        mockWebServer.start(0)
        mockWebServer.start(InetAddress.getLocalHost(), 0)
        mockWebServer.shutdown()
        var dispatcher: okhttp3.mockwebserver.Dispatcher = mockWebServer.dispatcher
        dispatcher = mockWebServer.dispatcher
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Nov 05 18:28:35 GMT 2025
    - 47K bytes
    - Click Count (0)
  5. okhttp/src/jvmTest/kotlin/okhttp3/KotlinDeprecationErrorTest.kt

      }
    
      @Test @Disabled
      fun mockWebServer() {
        val mockWebServer = MockWebServer()
        var port: Int = mockWebServer.getPort()
        mockWebServer.setServerSocketFactory(ServerSocketFactory.getDefault())
        mockWebServer.setBodyLimit(0L)
        mockWebServer.setProtocolNegotiationEnabled(false)
        mockWebServer.setProtocols(listOf(Protocol.HTTP_1_1))
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Fri Dec 27 13:39:56 GMT 2024
    - 13.3K bytes
    - Click Count (0)
  6. mockwebserver/README.md

    
    ### Example
    
    Use MockWebServer the same way that you use mocking frameworks like
    [Mockito](https://github.com/mockito/mockito):
    
    1. Script the mocks.
    2. Run application code.
    3. Verify that the expected requests were made.
    
    Here's a complete example:
    
    ### Java
    ```java
    public void test() throws Exception {
      // Create a MockWebServer. These are lean enough that you can create a new
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Thu Oct 30 21:39:59 GMT 2025
    - 8.1K bytes
    - Click Count (0)
  7. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/ClientAndServer.java

    import java.util.Collections;
    import okhttp3.OkHttpClient;
    import okhttp3.Protocol;
    import okhttp3.Request;
    import okhttp3.Response;
    import okhttp3.mockwebserver.MockResponse;
    import okhttp3.mockwebserver.MockWebServer;
    
    /**
     * Create UNIX domain sockets for MockWebServer and OkHttp and connect 'em together. Note that we
     * cannot do TLS over domain sockets.
     */
    public class ClientAndServer {
      public void run() throws Exception {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Mon Dec 24 03:46:30 GMT 2018
    - 2.1K bytes
    - Click Count (0)
  8. module-tests/src/test/java/okhttp3/modules/test/JavaModuleTest.java

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    package okhttp3.modules.test;
    
    import mockwebserver3.MockResponse;
    import mockwebserver3.MockWebServer;
    import okhttp3.Call;
    import okhttp3.Headers;
    import okhttp3.HttpUrl;
    import okhttp3.OkHttpClient;
    import okhttp3.Response;
    import okhttp3.logging.HttpLoggingInterceptor;
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sun Sep 21 06:22:22 GMT 2025
    - 2.1K bytes
    - Click Count (0)
  9. mockwebserver-junit5/src/main/kotlin/mockwebserver3/junit5/internal/StartStopExtension.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package mockwebserver3.junit5.internal
    
    import java.lang.reflect.Modifier
    import mockwebserver3.MockWebServer
    import mockwebserver3.junit5.StartStop
    import org.junit.jupiter.api.extension.BeforeAllCallback
    import org.junit.jupiter.api.extension.BeforeEachCallback
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Thu Jun 19 11:44:16 GMT 2025
    - 2.3K bytes
    - Click Count (0)
  10. mockwebserver/src/test/java/mockwebserver3/MockWebServerTest.kt

        }
      }
    
      @Test
      fun toStringIncludesLifecycleState() {
        val other = MockWebServer()
        assertThat(other.toString()).isEqualTo("MockWebServer{new}")
        other.use {
          other.start()
          assertThat(other.toString()).isEqualTo("MockWebServer{port=${other.port}}")
        }
        assertThat(other.toString()).isEqualTo("MockWebServer{closed}")
      }
    
      @Test
      fun closeWhileBlockedDispatching() {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sun Aug 03 22:38:00 GMT 2025
    - 28K bytes
    - Click Count (0)
Back to Top