Created
November 21, 2018 02:48
-
-
Save DiegoGSantos/4502eb8780f7c4ddc840465fda86df9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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