Mocking a http response using vert.x rxjava2 and Mockito
问题 I'm playing with the rxjava vert.x (ver. 3.8.4) WebClient. My client will call some services so, by Mockito (ver. 3.2.4) I'm testing how it should handle an error. Here is how I mock the service's response: ... JsonObject jsonResponse = new JsonObject(); HttpResponse<Buffer> httpResponse = Mockito.mock(HttpResponse.class); Mockito.when(httpResponse.statusCode()).thenReturn(500); Mockito.when(httpResponse.bodyAsJsonObject()).thenReturn(jsonResponse); HttpRequest<Buffer> httpRequest = Mockito