use of com.github.tomakehurst.wiremock.common.Errors in project wiremock by wiremock.
the class AdminApiTest method returnsBadEntityStatusWhenMatchesOperandIsWrongType.
@Test
public void returnsBadEntityStatusWhenMatchesOperandIsWrongType() {
WireMockResponse response = testClient.postJson("/__admin/mappings", "{\n" + " \"request\": {\n" + " \"bodyPatterns\": [\n" + " {\n" + " \"matches\": 12\n" + " }\n" + " ]\n" + " }\n" + "}");
assertThat(response.statusCode(), is(422));
Errors errors = Json.read(response.content(), Errors.class);
assertThat(errors.first().getSource().getPointer(), is("/request/bodyPatterns/0"));
assertThat(errors.first().getTitle(), is("Error parsing JSON"));
assertThat(errors.first().getDetail(), is("matches operand must be a non-null string"));
}
Aggregations