final question about testing a `weblient().get().....
# spring
p
final question about testing a
weblient().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
Copy code
@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