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);
}
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);
}
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);
}
Aggregations