use of com.github.tomakehurst.wiremock.verification.notmatched.NotMatchedRenderer in project wiremock by wiremock.
the class NotMatchedPageAcceptanceTest method supportsCustomNoMatchRenderer.
@Test
public void supportsCustomNoMatchRenderer() {
configure(wireMockConfig().notMatchedRenderer(new NotMatchedRenderer() {
@Override
protected ResponseDefinition render(Admin admin, Request request) {
return ResponseDefinitionBuilder.responseDefinition().withStatus(403).withBody("No you don't!").build();
}
}));
WireMockResponse response = testClient.get("/should-not-match");
assertThat(response.statusCode(), is(403));
assertThat(response.content(), is("No you don't!"));
}
Aggregations