Search in sources :

Example 1 with MatchingServiceRequestErrorState

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

the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInMatchingServiceRequestErrorState.

@Test
public void shouldReturnErrorResponseWhenAskedAndInMatchingServiceRequestErrorState() {
    MatchingServiceRequestErrorState state = MatchingServiceRequestErrorStateBuilder.aMatchingServiceRequestErrorState().build();
    StateController stateController = new MatchingServiceRequestErrorStateController(state, responseFromHubFactory);
    when(sessionRepository.getStateController(sessionId, ErrorResponsePreparedState.class)).thenReturn(stateController);
    ResponseFromHub responseFromHub = authnRequestFromTransactionHandler.getErrorResponseFromHub(sessionId);
    assertThat(responseFromHub.getStatus()).isEqualTo(TransactionIdaStatus.NoAuthenticationContext);
}
Also used : MatchingServiceRequestErrorState(uk.gov.ida.hub.policy.domain.state.MatchingServiceRequestErrorState) StateController(uk.gov.ida.hub.policy.domain.StateController) ResponseFromHub(uk.gov.ida.hub.policy.domain.ResponseFromHub) Test(org.junit.Test)

Example 2 with MatchingServiceRequestErrorState

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

the class AbstractMatchRequestSentStateController method getResponseProcessingDetails.

@Override
public ResponseProcessingDetails getResponseProcessingDetails() {
    if (matchingServiceRequestHasTimedOut()) {
        LOG.error("Matching service request timed out for session {}", state.getSessionId());
        MatchingServiceRequestErrorState matchingServiceRequestErrorState = new MatchingServiceRequestErrorState(state.getRequestId(), state.getRequestIssuerEntityId(), state.getSessionExpiryTimestamp(), state.getAssertionConsumerServiceUri(), state.getIdentityProviderEntityId(), state.getRelayState(), state.getSessionId(), state.getTransactionSupportsEidas());
        stateTransitionAction.transitionTo(matchingServiceRequestErrorState);
        return createResponseProcessingDetailsForStatus(ResponseProcessingStatus.SHOW_MATCHING_ERROR_PAGE);
    }
    return createResponseProcessingDetailsForStatus(ResponseProcessingStatus.WAIT);
}
Also used : MatchingServiceRequestErrorState(uk.gov.ida.hub.policy.domain.state.MatchingServiceRequestErrorState)

Example 3 with MatchingServiceRequestErrorState

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

the class AbstractMatchRequestSentStateController method handleRequestFailure.

@Override
public void handleRequestFailure() {
    MatchingServiceRequestErrorState matchingServiceRequestErrorState = new MatchingServiceRequestErrorState(state.getRequestId(), state.getRequestIssuerEntityId(), state.getSessionExpiryTimestamp(), state.getAssertionConsumerServiceUri(), state.getIdentityProviderEntityId(), state.getRelayState(), state.getSessionId(), state.getTransactionSupportsEidas());
    stateTransitionAction.transitionTo(matchingServiceRequestErrorState);
}
Also used : MatchingServiceRequestErrorState(uk.gov.ida.hub.policy.domain.state.MatchingServiceRequestErrorState)

Aggregations

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