@Test public void toResponse() { final EnclaveNotAvailableException exception = new EnclaveNotAvailableException("Enclave error"); final Response result = instance.toResponse(exception); assertThat(result).isNotNull(); assertThat(result.getStatus()).isEqualTo(503); assertThat(result.getEntity()).isEqualTo(exception.getMessage()); }
@Override public Response toResponse(final EnclaveNotAvailableException ex) { LOGGER.error("Enclave unavailable: {}", ex.getMessage()); LOGGER.debug(null, ex); return Response.status(Status.SERVICE_UNAVAILABLE).entity(ex.getMessage()).type(MediaType.TEXT_PLAIN).build(); }
EnclaveNotAvailableExceptionMapper implements ExceptionMapper<EnclaveNotAvailableException> { @Override public Response toResponse(final EnclaveNotAvailableException ex) { LOGGER.error("Enclave unavailable: {}", ex.getMessage()); LOGGER.debug(null, ex); return Response.status(Status.SERVICE_UNAVAILABLE).entity(ex.getMessage()).type(MediaType.TEXT_PLAIN).build(); } }
EnclaveNotAvailableExceptionMapper implements ExceptionMapper<EnclaveNotAvailableException> { @Override public Response toResponse(final EnclaveNotAvailableException ex) { LOGGER.error("Enclave unavailable: {}", ex.getMessage()); LOGGER.debug(null, ex); return Response.status(Status.SERVICE_UNAVAILABLE).entity(ex.getMessage()).type(MediaType.TEXT_PLAIN).build(); }  }
EnclaveNotAvailableExceptionMapper implements ExceptionMapper<EnclaveNotAvailableException> { @Override public Response toResponse(final EnclaveNotAvailableException ex) { LOGGER.error("Enclave unavailable: {}", ex.getMessage()); LOGGER.debug(null, ex); return Response.status(Status.SERVICE_UNAVAILABLE).entity(ex.getMessage()).type(MediaType.TEXT_PLAIN).build(); }  @Override Response toResponse(final EnclaveNotAvailableException ex); }
EnclaveNotAvailableExceptionMapper implements ExceptionMapper<EnclaveNotAvailableException> { @Override public Response toResponse(final EnclaveNotAvailableException ex) { LOGGER.error("Enclave unavailable: {}", ex.getMessage()); LOGGER.debug(null, ex); return Response.status(Status.SERVICE_UNAVAILABLE).entity(ex.getMessage()).type(MediaType.TEXT_PLAIN).build(); }  @Override Response toResponse(final EnclaveNotAvailableException ex);  }