@Test public void testToResponseSetsApplicationJsonContentType() { Response response = GeneralExceptionMapper.toResponse(new Exception("any"), BAD_REQUEST); assertThat(response.getHeaders().get("Content-type").get(0), is(MediaType.APPLICATION_JSON_TYPE)); }
@Override public Response toResponse(Exception exception) { try { return toResponse(exception, getStatus(exception)); } catch (Exception ex) { LOG.error("Error while generating status message. Original Exception was", exception); throw ex; } }
GeneralExceptionMapper implements ExceptionMapper<Exception> { @Override public Response toResponse(Exception exception) { try { return toResponse(exception, getStatus(exception)); } catch (Exception ex) { LOG.error("Error while generating status message. Original Exception was", exception); throw ex; } } }
GeneralExceptionMapper implements ExceptionMapper<Exception> { @Override public Response toResponse(Exception exception) { try { return toResponse(exception, getStatus(exception)); } catch (Exception ex) { LOG.error("Error while generating status message. Original Exception was", exception); throw ex; } }  }
GeneralExceptionMapper implements ExceptionMapper<Exception> { @Override public Response toResponse(Exception exception) { try { return toResponse(exception, getStatus(exception)); } catch (Exception ex) { LOG.error("Error while generating status message. Original Exception was", exception); throw ex; } }  @Override Response toResponse(Exception exception); }
GeneralExceptionMapper implements ExceptionMapper<Exception> { @Override public Response toResponse(Exception exception) { try { return toResponse(exception, getStatus(exception)); } catch (Exception ex) { LOG.error("Error while generating status message. Original Exception was", exception); throw ex; } }  @Override Response toResponse(Exception exception);  }