use of uk.gov.ida.exceptions.ApplicationException in project verify-hub by alphagov.
the class ExceptionAuditorTest method shouldNotAuditUnauditedExceptionIfItDoesNotRequireAuditing.
@Test
public void shouldNotAuditUnauditedExceptionIfItDoesNotRequireAuditing() {
ApplicationException exception = createUnauditedExceptionThatShouldNotBeAudited();
exceptionAuditor.auditException(exception, Optional.of(SESSION_ID));
verify(eventSinkMessageSender, never()).audit(any(Exception.class), any(UUID.class), any(SessionId.class), any(EventDetails.class));
}
use of uk.gov.ida.exceptions.ApplicationException in project verify-hub by alphagov.
the class ExceptionAuditorTest method shouldNotAuditAlreadyAuditedException.
@Test
public void shouldNotAuditAlreadyAuditedException() {
final UUID errorId = UUID.randomUUID();
ApplicationException exception = createAuditedException(ExceptionType.DUPLICATE_SESSION, errorId);
exceptionAuditor.auditException(exception, Optional.of(SESSION_ID));
verify(eventSinkMessageSender, never()).audit(any(Exception.class), any(UUID.class), any(SessionId.class), any(EventDetails.class));
}
use of uk.gov.ida.exceptions.ApplicationException in project verify-hub by alphagov.
the class SamlProxyApplicationExceptionMapperTest method shouldLogExceptionAtCorrectLevel.
@Test
public void shouldLogExceptionAtCorrectLevel() {
ApplicationException exception = createAuditedException(exceptionType, errorId);
mapper.toResponse(exception);
verify(levelLogger).log(eq(exception.getExceptionType().getLevel()), eq(exception), any(UUID.class));
}
use of uk.gov.ida.exceptions.ApplicationException in project verify-hub by alphagov.
the class HealthCheckEventLoggerTest method shouldNotLogToEventSinkIfTheExceptionIsAudited.
@Test
public void shouldNotLogToEventSinkIfTheExceptionIsAudited() {
ApplicationException unauditedException = ApplicationException.createAuditedException(ExceptionType.INVALID_SAML, UUID.randomUUID());
eventLogger.logException(unauditedException, "test error message");
verify(eventSinkProxy, times(0)).logHubEvent(any());
}
use of uk.gov.ida.exceptions.ApplicationException in project verify-hub by alphagov.
the class HealthCheckEventLoggerTest method shouldNotLogToEventSinkIfTheExceptionIsUnauditedButShouldNotBeaudited.
@Test
public void shouldNotLogToEventSinkIfTheExceptionIsUnauditedButShouldNotBeaudited() {
ApplicationException unauditedException = ApplicationException.createUnauditedException(ExceptionType.NETWORK_ERROR, UUID.randomUUID());
eventLogger.logException(unauditedException, "test error message");
verify(eventSinkProxy, times(0)).logHubEvent(any());
}
Aggregations