use of au.com.dius.pact.consumer.junit.exampleclients.ConsumerHttpsClient in project pact-jvm by DiUS.
the class PactProviderHttpsKeystoreTest method testSslHandshakeException.
@Test(expected = SSLHandshakeException.class)
@PactVerification(value = "test_provider")
public void testSslHandshakeException() throws IOException {
testKeystoreHappyPath();
new ConsumerHttpsClient(mockTestProvider.getConfig().url()).getAsMap("/", "");
}
use of au.com.dius.pact.consumer.junit.exampleclients.ConsumerHttpsClient in project pact-jvm by DiUS.
the class PactProviderHttpsTest method runTestWithUserCodeFailure.
@Test(expected = AssertionError.class)
@PactVerification("test_provider")
public void runTestWithUserCodeFailure() throws IOException {
Assert.assertEquals(new ConsumerHttpsClient(mockTestProvider.getConfig().url()).options("/second"), 200);
Map expectedResponse = new HashMap();
expectedResponse.put("responsetest", true);
expectedResponse.put("name", "fred");
assertEquals(new ConsumerHttpsClient(mockTestProvider.getConfig().url()).getAsMap("/", ""), expectedResponse);
}
use of au.com.dius.pact.consumer.junit.exampleclients.ConsumerHttpsClient in project pact-jvm by DiUS.
the class PactProviderHttpsTest method runTest.
@Test
@PactVerification(value = "test_provider")
public void runTest() throws IOException {
LOGGER.info("Config: " + mockTestProvider.getConfig());
Assert.assertEquals(new ConsumerHttpsClient(mockTestProvider.getConfig().url()).options("/second"), 200);
Map expectedResponse = new HashMap();
expectedResponse.put("responsetest", true);
expectedResponse.put("name", "harry");
assertEquals(new ConsumerHttpsClient(mockTestProvider.getConfig().url()).getAsMap("/", ""), expectedResponse);
}
Aggregations