WireMock
Some code for WireMock. @Test public void test() throws Exception { String url = “http://localhost:8080/v3”; stubFor(get(urlPathEqualTo(“/v3”)).willReturn(aResponse() .withHeader(“Content-Type”, “application/json”) .withBody(“{ \”id\”: 123, \”name\”: \”John Doe\” }”) .withStatus(200))); stubFor(get(urlPathEqualTo(“/v4”)).willReturn(aResponse() .withHeader(“Content-Type”, “application/json”) .withBody(“{ \”id\”: 123321, \”name\”: \”John Doe\” }”) .withStatus(200))); stubFor(get(urlPathEqualTo(“/v3”)) .withQueryParam(“abc”, equalTo(“5”)) .willReturn(aResponse() .withHeader(“Content-Type”, “application/json”) .withBody(“{ \”id\”: v33, \”name\”: \”John Doe\” }”) .withStatus(200) )); HttpClient client =… Read More »