use of uk.gov.ida.hub.policy.domain.StateController in project verify-hub by alphagov.
the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInNoMatchState.
@Test
public void shouldReturnErrorResponseWhenAskedAndInNoMatchState() {
NoMatchState state = NoMatchStateBuilder.aNoMatchState().build();
StateController stateController = new NoMatchStateController(state, responseFromHubFactory);
when(sessionRepository.getStateController(sessionId, ErrorResponsePreparedState.class)).thenReturn(stateController);
ResponseFromHub responseFromHub = authnRequestFromTransactionHandler.getErrorResponseFromHub(sessionId);
assertThat(responseFromHub.getStatus()).isEqualTo(TransactionIdaStatus.NoAuthenticationContext);
}
use of uk.gov.ida.hub.policy.domain.StateController in project verify-hub by alphagov.
the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInCycle3DataInputCancelledState.
@Test
public void shouldReturnErrorResponseWhenAskedAndInCycle3DataInputCancelledState() {
Cycle3DataInputCancelledState state = Cycle3DataInputCancelledStateBuilder.aCycle3DataInputCancelledState().build();
StateController stateController = new Cycle3DataInputCancelledStateController(state, responseFromHubFactory);
when(sessionRepository.getStateController(sessionId, ErrorResponsePreparedState.class)).thenReturn(stateController);
ResponseFromHub responseFromHub = authnRequestFromTransactionHandler.getErrorResponseFromHub(sessionId);
assertThat(responseFromHub.getStatus()).isEqualTo(TransactionIdaStatus.NoAuthenticationContext);
}
use of uk.gov.ida.hub.policy.domain.StateController in project verify-hub by alphagov.
the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInUserAccountCreationRequestSentState.
@Test
public void shouldReturnErrorResponseWhenAskedAndInUserAccountCreationRequestSentState() {
UserAccountCreationRequestSentState state = UserAccountCreationRequestSentStateBuilder.aUserAccountCreationRequestSentState().build();
StateController stateController = new UserAccountCreationRequestSentStateController(state, stateTransitionAction, hubEventLogger, policyConfiguration, levelOfAssuranceValidator, responseFromHubFactory, attributeQueryService);
when(sessionRepository.getStateController(sessionId, ErrorResponsePreparedState.class)).thenReturn(stateController);
ResponseFromHub responseFromHub = authnRequestFromTransactionHandler.getErrorResponseFromHub(sessionId);
assertThat(responseFromHub.getStatus()).isEqualTo(TransactionIdaStatus.NoAuthenticationContext);
}
use of uk.gov.ida.hub.policy.domain.StateController 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);
}
Aggregations