Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
val dispatcher = object : Dispatcher() {
@Throws(InterruptedException::class)
override fun dispatch(request: RecordedRequest): MockResponse {
return when {
request.path == "/v1/token" -> MockResponse().setResponseCode(200).setBody(getJson("json/token.json"))
request.path == "v1/events" -> MockResponse().setResponseCode(200).setBody(getJson("json/eventos.json"))
else -> MockResponse().setResponseCode(404)
}
}
}
server.setDispatcher(dispatcher)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment