### Question:
SamlProxyExceptionMapper extends AbstractContextExceptionMapper<Exception> { @Override protected Response handleException(Exception exception) { UUID errorId = UUID.randomUUID(); levelLogger.log(ExceptionType.UNKNOWN.getLevel(), exception, errorId); return Response.serverError() .entity(ErrorStatusDto.createAuditedErrorStatus(errorId, ExceptionType.UNKNOWN)) .build(); } @Inject  SamlProxyExceptionMapper(
            Provider<HttpServletRequest> contextProvider,
            LevelLoggerFactory<SamlProxyExceptionMapper> levelLoggerFactory);   }### Answer:
@Test public void shouldCreateAuditedErrorResponse() throws Exception { Response response = exceptionMapper.handleException(new RuntimeException()); ErrorStatusDto responseEntity = (ErrorStatusDto) response.getEntity(); assertThat(response.getStatus()).isEqualTo(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); assertThat(responseEntity.isAudited()).isTrue(); }
@Test public void shouldLogExceptionAtErrorLevel() throws Exception { RuntimeException exception = new RuntimeException(); exceptionMapper.handleException(exception); verify(levelLogger).log(eq(Level.ERROR), eq(exception), any(UUID.class)); }