@Test public void should_convert_exception_to_response() throws Exception { String message = "invalid certificate"; CertificateException certificateException = new CertificateException(message); Response response = certificateExceptionMapper.toResponse(certificateException); assertThat(response.getStatusInfo()).isEqualTo(BAD_REQUEST); assertThat(response.getEntity()).isEqualTo(message); }
@Override public Response toResponse(CertificateException exception) { LOGGER.error(exception); return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).build(); }
CertificateExceptionMapper implements ExceptionMapper<CertificateException> { @Override public Response toResponse(CertificateException exception) { LOGGER.error(exception); return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).build(); } }
CertificateExceptionMapper implements ExceptionMapper<CertificateException> { @Override public Response toResponse(CertificateException exception) { LOGGER.error(exception); return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).build(); }  }
CertificateExceptionMapper implements ExceptionMapper<CertificateException> { @Override public Response toResponse(CertificateException exception) { LOGGER.error(exception); return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).build(); }  @Override Response toResponse(CertificateException exception); }
CertificateExceptionMapper implements ExceptionMapper<CertificateException> { @Override public Response toResponse(CertificateException exception) { LOGGER.error(exception); return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).build(); }  @Override Response toResponse(CertificateException exception);  }