scottiedog45
06/24/2019, 6:05 PM: Dispatcher = object : Dispatcher()
fun updateErrorCodeForUrl(url: String, errorCode: Int) : Dispatcher = object : Dispatcher() {
@Throws(InterruptedException::class)
override fun dispatch(request: RecordedRequest): MockResponse {
when (request.path) {
url -> return MockResponse()
.setResponseCode(errorCode)
}
return MockResponse().setResponseCode(422)
}
}
Shawn
06/24/2019, 6:09 PMShawn
06/24/2019, 6:09 PMShawn
06/24/2019, 6:10 PMfun updateErrorCodeForUrl(url: String, errorCode: Int): Dispatcher {
return object : Dispatcher() {
dknapp
06/24/2019, 6:10 PMShawn
06/24/2019, 6:11 PMobject : SuperType
is how anonymous classes are instantiated with an inheriting class or interfacescottiedog45
06/24/2019, 6:41 PM