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