Search in sources :

Example 1 with MockHttpsKeystoreProviderConfig

use of au.com.dius.pact.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.getKeystorePassword()).when().options(mockTestProvider.getConfig().url() + "/second").then().statusCode(200);
    RestAssured.given().header("testreqheader", "testreqheadervalue").trustStore(config.getKeystore(), config.getKeystorePassword()).when().get(mockTestProvider.getConfig().url() + "/").then().body("responsetest", Matchers.equalTo(true)).body("name", Matchers.equalTo("harry"));
}
Also used : MockHttpsKeystoreProviderConfig(au.com.dius.pact.model.MockHttpsKeystoreProviderConfig) PactVerification(au.com.dius.pact.consumer.PactVerification) Test(org.junit.Test)

Aggregations

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