@Test public void toResponseStandard() { JsonProcessingExceptionMapper mapper = new JsonProcessingExceptionMapper(); JsonParseException e = new JsonParseException("Parsing Error", null); Response r = mapper.toResponse(e); assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), r.getStatus()); assertNotNull(r.getEntity()); StandardError error = (StandardError) r.getEntity(); assertEquals("Parsing Error", error.getMessage()); }
@Override public Response toResponse(JsonProcessingException exception) { return Response.status(Response.Status.BAD_REQUEST).entity(new StandardError(exception)) .type(MediaType.APPLICATION_JSON).build(); }
JsonProcessingExceptionMapper implements ExceptionMapper<JsonProcessingException> { @Override public Response toResponse(JsonProcessingException exception) { return Response.status(Response.Status.BAD_REQUEST).entity(new StandardError(exception)) .type(MediaType.APPLICATION_JSON).build(); } }
JsonProcessingExceptionMapper implements ExceptionMapper<JsonProcessingException> { @Override public Response toResponse(JsonProcessingException exception) { return Response.status(Response.Status.BAD_REQUEST).entity(new StandardError(exception)) .type(MediaType.APPLICATION_JSON).build(); }  }
JsonProcessingExceptionMapper implements ExceptionMapper<JsonProcessingException> { @Override public Response toResponse(JsonProcessingException exception) { return Response.status(Response.Status.BAD_REQUEST).entity(new StandardError(exception)) .type(MediaType.APPLICATION_JSON).build(); }  @Override Response toResponse(JsonProcessingException exception); }
JsonProcessingExceptionMapper implements ExceptionMapper<JsonProcessingException> { @Override public Response toResponse(JsonProcessingException exception) { return Response.status(Response.Status.BAD_REQUEST).entity(new StandardError(exception)) .type(MediaType.APPLICATION_JSON).build(); }  @Override Response toResponse(JsonProcessingException exception);  }