MockWebServerRule

class MockWebServerRule : 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 the @Rule annotation:

@Rule public final MockWebServerRule serverRule = new MockWebServerRule();

For Kotlin the @JvmField annotation is also necessary:

@JvmField @Rule val serverRule = MockWebServerRule()

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun apply(p0: Statement, p1: Description): Statement