@Test
public void responseConstraintViolationExceptionCausesInternalServerError() {

  ConstraintViolationException exception = mock(ResponseConstraintViolationException.class);
  when(exception.getMessage()).thenReturn("error");
  try (Response response = exceptionMapper.toResponse(exception)) {
    assertThat(response.getStatus(), is(INTERNAL_SERVER_ERROR.getStatusCode()));
    ErrorResponse error = (ErrorResponse) response.getEntity();
    assertThat(error.error, is("error"));
  }
}