Search in sources :

Example 1 with EidasAwaitingCycle3DataState

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

the class EidasCycle0And1MatchRequestSentStateControllerTest method shouldReturnEidasAwaitingCycle3DataState.

@Test
public void shouldReturnEidasAwaitingCycle3DataState() {
    when(transactionsConfigProxy.getMatchingProcess(state.getRequestIssuerEntityId())).thenReturn(new MatchingProcess(Optional.of("cycle3AttributeName")));
    doNothing().when(hubEventLogger).logWaitingForCycle3AttributesEvent(state.getSessionId(), state.getRequestIssuerEntityId(), state.getRequestId(), state.getSessionExpiryTimestamp());
    EidasAwaitingCycle3DataState expectedState = new EidasAwaitingCycle3DataState(state.getRequestId(), state.getRequestIssuerEntityId(), state.getSessionExpiryTimestamp(), state.getAssertionConsumerServiceUri(), state.getSessionId(), state.getTransactionSupportsEidas(), state.getIdentityProviderEntityId(), state.getMatchingServiceAdapterEntityId(), state.getRelayState(), state.getPersistentId(), state.getIdpLevelOfAssurance(), state.getEncryptedIdentityAssertion());
    State actualState = eidasCycle0And1MatchRequestSentStateController.getNextStateForNoMatch();
    assertThat(actualState).isEqualTo(expectedState);
}
Also used : EidasAwaitingCycle3DataState(uk.gov.ida.hub.policy.domain.state.EidasAwaitingCycle3DataState) NoMatchState(uk.gov.ida.hub.policy.domain.state.NoMatchState) EidasSuccessfulMatchState(uk.gov.ida.hub.policy.domain.state.EidasSuccessfulMatchState) EidasCycle0And1MatchRequestSentState(uk.gov.ida.hub.policy.domain.state.EidasCycle0And1MatchRequestSentState) EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState(uk.gov.ida.hub.policy.builder.state.EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState) State(uk.gov.ida.hub.policy.domain.State) EidasAwaitingCycle3DataState(uk.gov.ida.hub.policy.domain.state.EidasAwaitingCycle3DataState) MatchingProcess(uk.gov.ida.hub.policy.domain.MatchingProcess) Test(org.junit.Test)

Example 2 with EidasAwaitingCycle3DataState

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

the class EidasAwaitingCycle3DataStateBuilderTest method build.

@Test
public void build() {
    EidasAwaitingCycle3DataState state = EidasAwaitingCycle3DataStateBuilder.anEidasAwaitingCycle3DataState().build();
    assertThat(state.getRequestId()).isEqualTo("requestId");
    assertThat(state.getRequestIssuerEntityId()).isEqualTo("requestIssuerId");
    assertThat(state.getSessionExpiryTimestamp()).isEqualTo(DateTime.now().plusMinutes(10));
    assertThat(state.getAssertionConsumerServiceUri()).isEqualTo(URI.create("assertionConsumerServiceUri"));
    assertThat(state.getSessionId()).isEqualTo(new SessionId("sessionId"));
    assertThat(state.getTransactionSupportsEidas()).isEqualTo(true);
    assertThat(state.getIdentityProviderEntityId()).isEqualTo("identityProviderEntityId");
    assertThat(state.getMatchingServiceEntityId()).isEqualTo("matchingServiceAdapterEntityId");
    assertThat(state.getRelayState()).isEqualTo(Optional.of("relayState"));
    assertThat(state.getPersistentId()).isEqualTo(new PersistentId("nameId"));
    assertThat(state.getLevelOfAssurance()).isEqualTo(LevelOfAssurance.LEVEL_2);
    assertThat(state.getEncryptedIdentityAssertion()).isEqualTo("encryptedIdentityAssertion");
}
Also used : EidasAwaitingCycle3DataState(uk.gov.ida.hub.policy.domain.state.EidasAwaitingCycle3DataState) SessionId(uk.gov.ida.hub.policy.domain.SessionId) PersistentId(uk.gov.ida.hub.policy.domain.PersistentId) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 EidasAwaitingCycle3DataState (uk.gov.ida.hub.policy.domain.state.EidasAwaitingCycle3DataState)2 EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState (uk.gov.ida.hub.policy.builder.state.EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState)1 MatchingProcess (uk.gov.ida.hub.policy.domain.MatchingProcess)1 PersistentId (uk.gov.ida.hub.policy.domain.PersistentId)1 SessionId (uk.gov.ida.hub.policy.domain.SessionId)1 State (uk.gov.ida.hub.policy.domain.State)1 EidasCycle0And1MatchRequestSentState (uk.gov.ida.hub.policy.domain.state.EidasCycle0And1MatchRequestSentState)1 EidasSuccessfulMatchState (uk.gov.ida.hub.policy.domain.state.EidasSuccessfulMatchState)1 NoMatchState (uk.gov.ida.hub.policy.domain.state.NoMatchState)1