use of org.apache.hc.core5.http.HttpResponse in project pact-jvm by DiUS.
the class V4HttpPactTest method runTest.
@Test
void runTest(MockServer mockServer) throws IOException {
ClassicHttpResponse httpResponse = (ClassicHttpResponse) Request.get(mockServer.getUrl()).execute().returnResponse();
assertThat(httpResponse.getCode(), is(200));
assertThat(new String(httpResponse.getEntity().getContent().readAllBytes()), is(equalTo("{\"responsetest\": true, \"version\": \"v3\"}")));
}
use of org.apache.hc.core5.http.HttpResponse in project pact-jvm by DiUS.
the class PactProviderWithMultipleFragmentsTest method runTestWithPactVerificationsAndDefaultResponseValuesArePresent.
@Test
@PactVerifications({ @PactVerification(value = "test_provider2", fragment = "createFragment2") })
public void runTestWithPactVerificationsAndDefaultResponseValuesArePresent() throws IOException {
HttpResponse httpResponse = Request.get(mockTestProvider2.getUrl()).addHeader("testreqheader", "testreqheadervalue").execute().returnResponse();
assertThat(Arrays.stream(httpResponse.getHeaders("testresheader")).map(Header::getValue).collect(Collectors.toList()), is(equalTo(List.of("testresheadervalue"))));
}
Aggregations