@Test
public void handleExceptionsReturnsResponseOnFailure() {

  try (Response response = resource.handleExceptions(() -> {
    throw new RuntimeException("error");
  })) {
    assertThat(response.getStatus(), is(INTERNAL_SERVER_ERROR.getStatusCode()));
    assertThat(response.readEntity(ErrorResponse.class).error, is("error"));
  }
}