A DSL to define Dispatchers for OkHttp MockWebServer.
val server = MockWebServer()
val dispatcher = mockResponses {
matchBody("foo") { MockResponse().setResponseCode(201) }
matchPath("bar") { MockResponse().setResponseCode(200).setBody("baz") }
matchMethod("GET") { MockResponse().setResponseCode(403) }
matchMethod("POST") { MockResponse().setResponseCode(200) }
}
server.dispatcher = dispatcher
mock-server-dsl is provided under the MIT license.