use of au.com.dius.pact.consumer.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());
MockHttpsProviderConfig config = (MockHttpsProviderConfig) mockTestProvider.getConfig();
LOGGER.info("Config Cert: " + config.getHttpsCertificate().certificate());
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);
}
use of au.com.dius.pact.consumer.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.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);
}
Aggregations