pdegand
12/10/2019, 3:03 PMweblient().get()...awaitExchange().awaitBody()
call.
I have setup a MockWebServer from OkHttp and for a first try, I just want to see if I can get the String of the body, so I did something like
@Test
fun myTest() = runBlockingTest {
val mockResponse = MockResponse().apply { setBody("foo") }
mockServer.enqueue(mockResponse)
val string = webclient.get().uri(mockServer.url("/").toString).awaitExchange().awaitBody()
assertThat(string).isEqualTo("foo")
}
But the test is crashing with IllegaleStateException : This job has not completed yet