Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for MockWebServerRule (0.22 sec)

  1. mockwebserver-junit4/src/main/kotlin/mockwebserver3/junit4/MockWebServerRule.kt

     * the `@Rule` annotation:
     *
     * ```java
     * @Rule public final MockWebServerRule serverRule = new MockWebServerRule();
     * ```
     *
     * For Kotlin the `@JvmField` annotation is also necessary:
     *
     * ```kotlin
     * @JvmField @Rule val serverRule = MockWebServerRule()
     * ```
     */
    @ExperimentalOkHttpApi
    class MockWebServerRule : ExternalResource() {
      val server: MockWebServer = MockWebServer()
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 1.8K bytes
    - Viewed (1)
  2. mockwebserver-junit4/api/mockwebserver3-junit4.api

    public final class mockwebserver3/junit4/MockWebServerRule : org/junit/rules/ExternalResource {
    	public static final field Companion Lmockwebserver3/junit4/MockWebServerRule$Companion;
    	public fun <init> ()V
    	public final fun getServer ()Lmockwebserver3/MockWebServer;
    }
    
    public final class mockwebserver3/junit4/MockWebServerRule$Companion {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Feb 26 19:17:33 GMT 2022
    - 346 bytes
    - Viewed (0)
  3. mockwebserver-junit4/README.md

    ```
    @Rule public final MockWebServerRule serverRule = new MockWebServerRule();
    ```
    
    The `serverRule` field has a `server` field. It is an instance of `MockWebServer`. That instance
    will be shut down automatically after the test runs.
    
    For Kotlin, the `@JvmField` annotation is also necessary:
    
    ```
    @JvmField @Rule val serverRule = MockWebServerRule()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 707 bytes
    - Viewed (1)
  4. mockwebserver-junit4/src/test/java/mockwebserver3/junit4/MockWebServerRuleTest.kt

    import org.junit.Assert.fail
    import org.junit.Test
    import org.junit.runner.Description
    import org.junit.runners.model.Statement
    
    class MockWebServerRuleTest {
      @Test fun statementStartsAndStops() {
        val rule = MockWebServerRule()
        val called = AtomicBoolean()
        val statement: Statement =
          rule.apply(
            object : Statement() {
              override fun evaluate() {
                called.set(true)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (1)
  5. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

    import assertk.fail
    import java.net.InetAddress
    import java.net.UnknownHostException
    import java.util.concurrent.CountDownLatch
    import mockwebserver3.MockResponse
    import mockwebserver3.junit4.MockWebServerRule
    import okhttp3.AsyncDns
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Request
    import okhttp3.tls.HandshakeCertificates
    import okhttp3.tls.HeldCertificate
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  6. docs/changelogs/changelog_2x.md

           <version>1.6.0</version>
         </dependency>
         ```
    
     *  New: `Cache.initialize()`. Call this on a background thread to eagerly
        initialize the response cache.
     *  New: Fold `MockWebServerRule` into `MockWebServer`. This makes it easier to
        write JUnit tests with `MockWebServer`. The `MockWebServer` library now
        depends on JUnit, though it continues to work with all testing frameworks.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 26.6K bytes
    - Viewed (0)
Back to top