Skip to content

Instantly share code, notes, and snippets.

@DiegoGSantos
Created November 21, 2018 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DiegoGSantos/4502eb8780f7c4ddc840465fda86df9b to your computer and use it in GitHub Desktop.
Save DiegoGSantos/4502eb8780f7c4ddc840465fda86df9b to your computer and use it in GitHub Desktop.
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