use of au.com.dius.pact.consumer.exampleclients.ConsumerClient in project pact-jvm by DiUS.
the class PactDslJsonBodyTest method runTest.
@Override
protected void runTest(MockServer mockServer) {
Map response;
try {
response = new ConsumerClient(mockServer.getUrl()).getAsMap("/", "");
} catch (Exception e) {
throw new RuntimeException(e);
}
Map<String, Object> object2 = (Map<String, Object>) response.get("2");
assertThat(object2, hasKey("test"));
assertThat(object2.get("test"), is(nullValue()));
}
use of au.com.dius.pact.consumer.exampleclients.ConsumerClient in project pact-jvm by DiUS.
the class ExampleJavaConsumerPactRuleTest method runTest.
@Test
@PactVerification("test_provider")
public void runTest() throws IOException {
Assert.assertEquals(new ConsumerClient("http://localhost:8080").options("/second"), 200);
Map expectedResponse = new HashMap();
expectedResponse.put("responsetest", true);
expectedResponse.put("name", "harry");
assertEquals(new ConsumerClient("http://localhost:8080").getAsMap("/", ""), expectedResponse);
}
use of au.com.dius.pact.consumer.exampleclients.ConsumerClient in project pact-jvm by DiUS.
the class V3ConsumerPactTest method runTest.
@Override
protected void runTest(MockServer mockServer) throws IOException {
Map expectedResponse = new HashMap();
expectedResponse.put("responsetest", true);
expectedResponse.put("version", "v3");
assertEquals(new ConsumerClient(mockServer.getUrl()).getAsMap("/", ""), expectedResponse);
}
use of au.com.dius.pact.consumer.exampleclients.ConsumerClient in project pact-jvm by DiUS.
the class V3PactProviderTest method runTest.
@Test
@PactVerification
public void runTest() throws IOException {
Map expectedResponse = new HashMap();
expectedResponse.put("responsetest", true);
expectedResponse.put("version", "v3");
assertEquals(new ConsumerClient(mockTestProvider.getUrl()).getAsMap("/", ""), expectedResponse);
}
Aggregations