use of au.com.dius.pact.consumer.PactVerification in project pact-jvm by DiUS.
the class ExampleJavaConsumerPactRuleTest method runTest.
@Test
@PactVerification("test_provider")
public void runTest() throws IOException {
Assert.assertEquals(new ConsumerClient("http://localhost:8080").options("/second"), 200);
Map expectedResponse = new HashMap();
expectedResponse.put("responsetest", true);
expectedResponse.put("name", "harry");
assertEquals(new ConsumerClient("http://localhost:8080").getAsMap("/", ""), expectedResponse);
}
use of au.com.dius.pact.consumer.PactVerification in project pact-jvm by DiUS.
the class V3PactProviderTest method runTest.
@Test
@PactVerification
public void runTest() throws IOException {
Map expectedResponse = new HashMap();
expectedResponse.put("responsetest", true);
expectedResponse.put("version", "v3");
assertEquals(new ConsumerClient(mockTestProvider.getUrl()).getAsMap("/", ""), expectedResponse);
}
use of au.com.dius.pact.consumer.PactVerification in project verify-hub by alphagov.
the class EidasSessionResourceContractTest method shouldGetValidatedEidasAuthnResponseFromSamlEngineVerification.
@PactVerification(value = SAML_ENGINE_SERVICE, fragment = "shouldGetValidatedEidasAuthnResponseFromSamlEngine")
@Test
public void shouldGetValidatedEidasAuthnResponseFromSamlEngineVerification() throws Exception {
configStub.setupStubForEidasRPCountries(TEST_RP, EIDAS_COUNTRIES.stream().map(EidasCountryDto::getEntityId).collect(Collectors.toList()));
SessionId sessionId = createSessionInCountrySelectingState();
selectACountry(sessionId);
Response response = postAuthnResponseToPolicy(sessionId);
assertThatResponseIsSuccess(response);
assertThatAQRReceivedBySamlSoapProxyHasSameDataAsSamlEngineSent();
}
Aggregations