@Test public void testPersistenceExceptionMapper() { PersistenceExceptionMapper mapper = new PersistenceExceptionMapper(); Response response = mapper.toResponse(exception); assertNotNull(response); assertEquals(INTERNAL_SERVER_ERROR, response.getStatus()); }
@Override public Response toResponse(PersistenceException e) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); }
PersistenceExceptionMapper implements ExceptionMapper<PersistenceException> { @Override public Response toResponse(PersistenceException e) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); } }
PersistenceExceptionMapper implements ExceptionMapper<PersistenceException> { @Override public Response toResponse(PersistenceException e) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); }  }
PersistenceExceptionMapper implements ExceptionMapper<PersistenceException> { @Override public Response toResponse(PersistenceException e) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); }  @Override Response toResponse(PersistenceException e); }
PersistenceExceptionMapper implements ExceptionMapper<PersistenceException> { @Override public Response toResponse(PersistenceException e) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build(); }  @Override Response toResponse(PersistenceException e);  }