Search in sources :

Example 11 with ClassicHttpResponse

use of org.apache.hc.core5.http.ClassicHttpResponse 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\"}")));
}
Also used : ClassicHttpResponse(org.apache.hc.core5.http.ClassicHttpResponse) Test(org.junit.jupiter.api.Test)

Aggregations

ClassicHttpResponse (org.apache.hc.core5.http.ClassicHttpResponse)11 Test (org.junit.jupiter.api.Test)7 HttpEntity (org.apache.hc.core5.http.HttpEntity)2 Test (org.junit.Test)2 PactVerification (au.com.dius.pact.consumer.junit.PactVerification)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 Result (com.google.refine.importing.UrlRewriter.Result)1 HttpClient (com.google.refine.util.HttpClient)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 URL (java.net.URL)1 URLConnection (java.net.URLConnection)1 Charset (java.nio.charset.Charset)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1