@Test public void testForbidden() { JerseyExceptionMapper mapper = new JerseyExceptionMapper(); ForbiddenException e = new ForbiddenException(); Response r = mapper.toResponse(e); ErrorResponse er = (ErrorResponse) r.getEntity(); assertEquals(Status.FORBIDDEN.getStatusCode(), r.getStatus()); assertEquals(Status.FORBIDDEN, er.getHttpStatus()); assertEquals("HTTP 403 Forbidden", er.getErrorDescription()); assertEquals("forbidden", 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);  }