public void convertsExceptionToResponse() throws Exception {
final ConstraintsMapper mapper = new ConstraintsMapper();
final ConstraintViolationException cex =
Mockito.mock(ConstraintViolationException.class);
Mockito.doReturn("hello, world!").when(cex).getMessage();
mapper.setUriInfo(new UriInfoMocker().mock());
MatcherAssert.assertThat(
mapper.toResponse(cex).getEntity(),
Matchers.hasToString(Matchers.containsString("hello"))
);
}