NotAcceptableExceptionMapper extends CandlepinExceptionMapper implements ExceptionMapper<NotAcceptableException> { @Override public Response toResponse(NotAcceptableException exception) { return getDefaultBuilder(exception, Response.Status.NOT_ACCEPTABLE, determineBestMediaType()).build(); }  @Override Response toResponse(NotAcceptableException exception);  }
@Test public void handleNotAcceptableException() { NotAcceptableException nae = new NotAcceptableException("unacceptable"); NotAcceptableExceptionMapper naem = injector.getInstance(NotAcceptableExceptionMapper.class); Response r = naem.toResponse(nae); assertEquals(406, r.getStatus()); verifyMessage(r, rtmsg("unacceptable")); }