@Test
public void exceptionStatusAndMessageAreUsedInResponse() {

  try (Response response = mapper.toResponse(new WebApplicationException("error", BAD_REQUEST))) {
    assertThat(response.getStatus(), is(BAD_REQUEST.getStatusCode()));
    ErrorResponse error = (ErrorResponse) response.getEntity();
    assertThat(error.error, is("error"));
  }
}