Search in sources :

Example 1 with FraudEventDetectedState

use of uk.gov.ida.hub.policy.domain.state.FraudEventDetectedState in project verify-hub by alphagov.

the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInFraudEventDetectedState.

@Test
public void shouldReturnErrorResponseWhenAskedAndInFraudEventDetectedState() {
    FraudEventDetectedState state = FraudEventDetectedStateBuilder.aFraudEventDetectedState().build();
    StateController stateController = new FraudEventDetectedStateController(state, responseFromHubFactory, stateTransitionAction, null, null, null);
    when(sessionRepository.getStateController(sessionId, ErrorResponsePreparedState.class)).thenReturn(stateController);
    ResponseFromHub responseFromHub = authnRequestFromTransactionHandler.getErrorResponseFromHub(sessionId);
    assertThat(responseFromHub.getStatus()).isEqualTo(TransactionIdaStatus.NoAuthenticationContext);
}
Also used : FraudEventDetectedState(uk.gov.ida.hub.policy.domain.state.FraudEventDetectedState) StateController(uk.gov.ida.hub.policy.domain.StateController) ResponseFromHub(uk.gov.ida.hub.policy.domain.ResponseFromHub) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ResponseFromHub (uk.gov.ida.hub.policy.domain.ResponseFromHub)1 StateController (uk.gov.ida.hub.policy.domain.StateController)1 FraudEventDetectedState (uk.gov.ida.hub.policy.domain.state.FraudEventDetectedState)1