Search in sources :

Example 1 with Cycle3DataInputCancelledState

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

the class EidasAwaitingCycle3DataStateControllerTest method handleCancellation.

@Test
public void handleCancellation() {
    doNothing().when(hubEventLogger).logCycle3DataInputCancelled(state.getSessionId(), state.getRequestIssuerEntityId(), state.getSessionExpiryTimestamp(), state.getRequestId());
    final Cycle3DataInputCancelledState expectedState = new Cycle3DataInputCancelledState(state.getRequestId(), state.getSessionExpiryTimestamp(), state.getRelayState(), state.getRequestIssuerEntityId(), state.getAssertionConsumerServiceUri(), new SessionId(state.getSessionId().getSessionId()), state.getTransactionSupportsEidas());
    controller.handleCancellation();
    verify(stateTransitionAction).transitionTo(expectedState);
}
Also used : Cycle3DataInputCancelledState(uk.gov.ida.hub.policy.domain.state.Cycle3DataInputCancelledState) SessionId(uk.gov.ida.hub.policy.domain.SessionId) Test(org.junit.Test)

Example 2 with Cycle3DataInputCancelledState

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

the class AbstractAwaitingCycle3DataStateController method handleCancellation.

public void handleCancellation() {
    hubEventLogger.logCycle3DataInputCancelled(state.getSessionId(), state.getRequestIssuerEntityId(), state.getSessionExpiryTimestamp(), state.getRequestId());
    Cycle3DataInputCancelledState cycle3DataInputCancelledState = new Cycle3DataInputCancelledState(state.getRequestId(), state.getSessionExpiryTimestamp(), state.getRelayState(), state.getRequestIssuerEntityId(), state.getAssertionConsumerServiceUri(), new SessionId(state.getSessionId().getSessionId()), state.getTransactionSupportsEidas());
    stateTransitionAction.transitionTo(cycle3DataInputCancelledState);
}
Also used : Cycle3DataInputCancelledState(uk.gov.ida.hub.policy.domain.state.Cycle3DataInputCancelledState) SessionId(uk.gov.ida.hub.policy.domain.SessionId)

Example 3 with Cycle3DataInputCancelledState

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

the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInCycle3DataInputCancelledState.

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

Aggregations

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