KangarooExceptionMapper implements ExceptionMapper<KangarooException> { public Response toResponse(final KangarooException e) { return ErrorResponseBuilder.from(e).build(); }  Response toResponse(final KangarooException e);  }
@Test public void testToResponse() { KangarooExceptionMapper mapper = new KangarooExceptionMapper(); TestError jpe = new TestError(); Response r = mapper.toResponse(jpe); ErrorResponse er = (ErrorResponse) r.getEntity(); assertEquals(Status.FORBIDDEN.getStatusCode(), r.getStatus()); assertEquals(Status.FORBIDDEN, er.getHttpStatus()); assertEquals("test_error", er.getError()); assertEquals("Test Error", er.getErrorDescription()); }