@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")); } }
protected Response handleExceptions(Supplier<ResponseBuilder> responseBuilder) { return handleExceptions(() -> responseBuilder.get().build(), this::toErrorResponse); }
JaxRsResource extends ResourceBase { protected Response handleExceptions(Supplier<ResponseBuilder> responseBuilder) { return handleExceptions(() -> responseBuilder.get().build(), this::toErrorResponse); } }
JaxRsResource extends ResourceBase { protected Response handleExceptions(Supplier<ResponseBuilder> responseBuilder) { return handleExceptions(() -> responseBuilder.get().build(), this::toErrorResponse); }  }
JaxRsResource extends ResourceBase { protected Response handleExceptions(Supplier<ResponseBuilder> responseBuilder) { return handleExceptions(() -> responseBuilder.get().build(), this::toErrorResponse); }   }
JaxRsResource extends ResourceBase { protected Response handleExceptions(Supplier<ResponseBuilder> responseBuilder) { return handleExceptions(() -> responseBuilder.get().build(), this::toErrorResponse); }    }