UnhandledExceptionMapper implements ExceptionMapper<Exception> { public Response toResponse(final Exception exception) { return ErrorResponseBuilder .from(exception) .build(); }  Response toResponse(final Exception exception);  }
@Test public void testToResponse() { UnhandledExceptionMapper mapper = new UnhandledExceptionMapper(); Exception e = new Exception("test"); Response r = mapper.toResponse(e); ErrorResponse er = (ErrorResponse) r.getEntity(); assertEquals(Status.INTERNAL_SERVER_ERROR.getStatusCode(), r.getStatus()); assertEquals(Status.INTERNAL_SERVER_ERROR, er.getHttpStatus()); assertEquals("Internal Server Error", er.getErrorDescription()); }