Search in sources :

Example 1 with UserAccountCreationFailedState

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

the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndUserAccountCreationFailedState.

@Test
public void shouldReturnErrorResponseWhenAskedAndUserAccountCreationFailedState() {
    UserAccountCreationFailedState state = UserAccountCreationFailedStateBuilder.aUserAccountCreationFailedState().build();
    StateController stateController = new UserAccountCreationFailedStateController(state, responseFromHubFactory);
    when(sessionRepository.getStateController(sessionId, ErrorResponsePreparedState.class)).thenReturn(stateController);
    ResponseFromHub responseFromHub = authnRequestFromTransactionHandler.getErrorResponseFromHub(sessionId);
    assertThat(responseFromHub.getStatus()).isEqualTo(TransactionIdaStatus.NoAuthenticationContext);
}
Also used : StateController(uk.gov.ida.hub.policy.domain.StateController) UserAccountCreationFailedState(uk.gov.ida.hub.policy.domain.state.UserAccountCreationFailedState) 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 UserAccountCreationFailedState (uk.gov.ida.hub.policy.domain.state.UserAccountCreationFailedState)1