use of uk.gov.ida.exceptions.ApplicationException in project verify-hub by alphagov.
the class SamlProxyApplicationExceptionMapperTest method toResponse_shouldAuditException.
@Test
public void toResponse_shouldAuditException() {
URI exceptionUri = URI.create("/exception-uri");
ApplicationException exception = createUnauditedException(exceptionType, errorId, exceptionUri);
mapper.toResponse(exception);
verify(exceptionAuditor).auditException(exception, Optional.of(sessionId));
}
use of uk.gov.ida.exceptions.ApplicationException in project verify-hub by alphagov.
the class SamlProxyApplicationExceptionMapperTest method toResponse_shouldReturnAuditedErrorResponse.
@Test
public void toResponse_shouldReturnAuditedErrorResponse() {
ApplicationException exception = createAuditedException(exceptionType, errorId);
final Response response = mapper.toResponse(exception);
ErrorStatusDto responseEntity = (ErrorStatusDto) response.getEntity();
assertThat(response.getStatus()).isEqualTo(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
assertThat(responseEntity.isAudited()).isTrue();
}
Aggregations