Search in sources :

Example 1 with MockHttpsProviderConfig

use of au.com.dius.pact.model.MockHttpsProviderConfig 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);
}
Also used : ConsumerHttpsClient(au.com.dius.pact.consumer.exampleclients.ConsumerHttpsClient) HashMap(java.util.HashMap) MockHttpsProviderConfig(au.com.dius.pact.model.MockHttpsProviderConfig) HashMap(java.util.HashMap) Map(java.util.Map) PactVerification(au.com.dius.pact.consumer.PactVerification) Test(org.junit.Test)

Aggregations

PactVerification (au.com.dius.pact.consumer.PactVerification)1 ConsumerHttpsClient (au.com.dius.pact.consumer.exampleclients.ConsumerHttpsClient)1 MockHttpsProviderConfig (au.com.dius.pact.model.MockHttpsProviderConfig)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Test (org.junit.Test)1