@Test public void testNotFound() { JerseyExceptionMapper mapper = new JerseyExceptionMapper(); NotFoundException e = new NotFoundException(); Response r = mapper.toResponse(e); ErrorResponse er = (ErrorResponse) r.getEntity(); assertEquals(Status.NOT_FOUND.getStatusCode(), r.getStatus()); assertEquals(Status.NOT_FOUND, er.getHttpStatus()); assertEquals("HTTP 404 Not Found", er.getErrorDescription()); assertEquals("not_found", er.getError()); }
public Response toResponse(final WebApplicationException e) { return ErrorResponseBuilder .from(e) .build(); }
JerseyExceptionMapper implements ExceptionMapper<WebApplicationException> { public Response toResponse(final WebApplicationException e) { return ErrorResponseBuilder .from(e) .build(); } }
JerseyExceptionMapper implements ExceptionMapper<WebApplicationException> { public Response toResponse(final WebApplicationException e) { return ErrorResponseBuilder .from(e) .build(); }  }
JerseyExceptionMapper implements ExceptionMapper<WebApplicationException> { public Response toResponse(final WebApplicationException e) { return ErrorResponseBuilder .from(e) .build(); }  Response toResponse(final WebApplicationException e); }
JerseyExceptionMapper implements ExceptionMapper<WebApplicationException> { public Response toResponse(final WebApplicationException e) { return ErrorResponseBuilder .from(e) .build(); }  Response toResponse(final WebApplicationException e);  }