@Test public void handleExceptionsReturnsResponseOnFailure() { ResponseEntity<?> response = resource.handleExceptions(() -> { throw new RuntimeException("error"); }); assertThat(response.getStatusCode(), is(INTERNAL_SERVER_ERROR)); assertThat(((ErrorResponse) response.getBody()).error, is("error")); }
protected ResponseEntity<?> handleExceptions(Supplier<ResponseEntity<?>> response) { return handleExceptions(response::get, this::toErrorResponse); }
SpringWebResource extends ResourceBase { protected ResponseEntity<?> handleExceptions(Supplier<ResponseEntity<?>> response) { return handleExceptions(response::get, this::toErrorResponse); } }
SpringWebResource extends ResourceBase { protected ResponseEntity<?> handleExceptions(Supplier<ResponseEntity<?>> response) { return handleExceptions(response::get, this::toErrorResponse); }  }
SpringWebResource extends ResourceBase { protected ResponseEntity<?> handleExceptions(Supplier<ResponseEntity<?>> response) { return handleExceptions(response::get, this::toErrorResponse); }   }
SpringWebResource extends ResourceBase { protected ResponseEntity<?> handleExceptions(Supplier<ResponseEntity<?>> response) { return handleExceptions(response::get, this::toErrorResponse); }    }