use of au.com.dius.pact.core.model.IRequest in project pact-jvm by DiUS.
the class PactProviderTest method runTestWithPactError.
@Test
@PactVerification(value = "test_provider")
public void runTestWithPactError() throws IOException {
mockTestProvider.validateResultWith((result, t) -> {
assertThat(t, is(instanceOf(AssertionError.class)));
assertThat(t.getMessage(), startsWith("The following requests were not received:\n" + "\tmethod: GET\n" + "\tpath: /"));
assertThat(result, is(instanceOf(PactVerificationResult.ExpectedButNotReceived.class)));
PactVerificationResult.ExpectedButNotReceived error = (PactVerificationResult.ExpectedButNotReceived) result;
assertThat(error.getExpectedRequests(), hasSize(1));
IRequest request = error.getExpectedRequests().get(0);
assertThat(request.getPath(), is("/"));
});
Assert.assertEquals(new ConsumerClient(mockTestProvider.getUrl()).options("/second"), 200);
}
Aggregations