use of uk.gov.ida.hub.policy.domain.StateController in project verify-hub by alphagov.
the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInRequesterErrorState.
@Test
public void shouldReturnErrorResponseWhenAskedAndInRequesterErrorState() {
RequesterErrorState state = RequesterErrorStateBuilder.aRequesterErrorState().build();
StateController stateController = new RequesterErrorStateController(state, responseFromHubFactory, stateTransitionAction, transactionsConfigProxy, identityProvidersConfigProxy, hubEventLogger);
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 shouldReturnErrorResponseWhenAskedAndInCycle0And1MatchRequestSentState.
@Test
public void shouldReturnErrorResponseWhenAskedAndInCycle0And1MatchRequestSentState() {
Cycle0And1MatchRequestSentState state = Cycle0And1MatchRequestSentStateBuilder.aCycle0And1MatchRequestSentState().build();
StateController stateController = new Cycle0And1MatchRequestSentStateController(state, hubEventLogger, stateTransitionAction, policyConfiguration, levelOfAssuranceValidator, transactionsConfigProxy, responseFromHubFactory, assertionRestrictionFactory, matchingServiceConfigProxy, 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 StateControllerFactoryTest method build_shouldCreateACycle3MatchRequestDataSentController.
@Test
public void build_shouldCreateACycle3MatchRequestDataSentController() {
StateController controller = factory.build(aCycle3MatchRequestSentState().build(), stateTransitionAction);
assertThat(controller).isInstanceOf(Cycle3MatchRequestSentStateController.class);
}
use of uk.gov.ida.hub.policy.domain.StateController in project verify-hub by alphagov.
the class StateControllerFactoryTest method build_shouldCreateAUserAccountCreatedController.
@Test
public void build_shouldCreateAUserAccountCreatedController() {
StateController controller = factory.build(aUserAccountCreatedState().build(), stateTransitionAction);
assertThat(controller).isInstanceOf(UserAccountCreatedStateController.class);
}
use of uk.gov.ida.hub.policy.domain.StateController in project verify-hub by alphagov.
the class StateControllerFactoryTest method shouldCreateARequesterErrorStateController.
@Test
public void shouldCreateARequesterErrorStateController() {
StateController controller = factory.build(aRequesterErrorState().build(), stateTransitionAction);
assertThat(controller).isInstanceOf(RequesterErrorStateController.class);
}
Aggregations