Search in sources :

Example 1 with RequesterErrorState

use of uk.gov.ida.hub.policy.domain.state.RequesterErrorState 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);
}
Also used : RequesterErrorState(uk.gov.ida.hub.policy.domain.state.RequesterErrorState) 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 RequesterErrorState (uk.gov.ida.hub.policy.domain.state.RequesterErrorState)1