Search in sources :

Example 1 with MockHttpsKeystoreProviderConfig

use of au.com.dius.pact.consumer.model.MockHttpsKeystoreProviderConfig in project pact-jvm by DiUS.

the class PactProviderHttpsKeystoreTest method testKeystoreHappyPath.

@Test
@PactVerification(value = "test_provider")
public void testKeystoreHappyPath() {
    MockHttpsKeystoreProviderConfig config = (MockHttpsKeystoreProviderConfig) mockTestProvider.getConfig();
    LOGGER.info("Keystore path: " + config.getKeystore());
    RestAssured.given().header("testreqheader", "testreqheadervalue").trustStore(config.getKeystore(), config.getPassword()).when().options(mockTestProvider.getConfig().url() + "/second").then().statusCode(200);
    RestAssured.given().header("testreqheader", "testreqheadervalue").trustStore(config.getKeystore(), config.getPassword()).when().get(mockTestProvider.getConfig().url() + "/").then().body("responsetest", Matchers.equalTo(true)).body("name", Matchers.equalTo("harry"));
}
Also used : MockHttpsKeystoreProviderConfig(au.com.dius.pact.consumer.model.MockHttpsKeystoreProviderConfig) PactVerification(au.com.dius.pact.consumer.junit.PactVerification) Test(org.junit.Test)

Aggregations

PactVerification (au.com.dius.pact.consumer.junit.PactVerification)1 MockHttpsKeystoreProviderConfig (au.com.dius.pact.consumer.model.MockHttpsKeystoreProviderConfig)1 Test (org.junit.Test)1