@Test public void toResponse() { final TransactionNotFoundException transactionNotFoundException = new TransactionNotFoundException("OUCH"); final Response result = instance.toResponse(transactionNotFoundException); assertThat(result).isNotNull(); final String message = result.getEntity().toString(); assertThat(message).isEqualTo("OUCH"); assertThat(result.getStatus()).isEqualTo(404); }
@Override public Response toResponse(final TransactionNotFoundException e) { LOGGER.info(e.getMessage()); return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); }
TransactionNotFoundExceptionMapper implements ExceptionMapper<TransactionNotFoundException> { @Override public Response toResponse(final TransactionNotFoundException e) { LOGGER.info(e.getMessage()); return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); } }
TransactionNotFoundExceptionMapper implements ExceptionMapper<TransactionNotFoundException> { @Override public Response toResponse(final TransactionNotFoundException e) { LOGGER.info(e.getMessage()); return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); }  }
TransactionNotFoundExceptionMapper implements ExceptionMapper<TransactionNotFoundException> { @Override public Response toResponse(final TransactionNotFoundException e) { LOGGER.info(e.getMessage()); return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); }  @Override Response toResponse(final TransactionNotFoundException e); }
TransactionNotFoundExceptionMapper implements ExceptionMapper<TransactionNotFoundException> { @Override public Response toResponse(final TransactionNotFoundException e) { LOGGER.info(e.getMessage()); return Response.status(Response.Status.NOT_FOUND).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); }  @Override Response toResponse(final TransactionNotFoundException e);  }