use of uk.gov.ida.hub.policy.domain.state.EidasCycle3MatchRequestSentState in project verify-hub by alphagov.
the class EidasCycle3MatchRequestSentStateBuilderTest method withPersistentId.
@Test
public void withPersistentId() {
EidasCycle3MatchRequestSentState state = EidasCycle3MatchRequestSentStateBuilder.anEidasCycle3MatchRequestSentState().withPersistentId(DIFFERENT_NAME_ID).build();
assertThat(state.getPersistentId()).isEqualTo(DIFFERENT_NAME_ID);
}
use of uk.gov.ida.hub.policy.domain.state.EidasCycle3MatchRequestSentState in project verify-hub by alphagov.
the class EidasAwaitingCycle3DataStateControllerTest method shouldTransitionToEidasCycle3MatchRequestSentState.
@Test
public void shouldTransitionToEidasCycle3MatchRequestSentState() {
final String principalIpAddressAsSeenByHub = "principalIpAddressAsSeenByHub";
doNothing().when(hubEventLogger).logCycle3DataObtained(state.getSessionId(), state.getRequestIssuerEntityId(), state.getSessionExpiryTimestamp(), state.getRequestId(), principalIpAddressAsSeenByHub);
final EidasCycle3MatchRequestSentState expectedState = new EidasCycle3MatchRequestSentState(state.getRequestId(), state.getRequestIssuerEntityId(), state.getSessionExpiryTimestamp(), state.getAssertionConsumerServiceUri(), state.getSessionId(), state.getTransactionSupportsEidas(), state.getIdentityProviderEntityId(), state.getRelayState().orNull(), state.getLevelOfAssurance(), state.getMatchingServiceEntityId(), state.getEncryptedIdentityAssertion(), state.getPersistentId());
controller.handleCycle3DataSubmitted(principalIpAddressAsSeenByHub);
verify(stateTransitionAction).transitionTo(expectedState);
}
use of uk.gov.ida.hub.policy.domain.state.EidasCycle3MatchRequestSentState in project verify-hub by alphagov.
the class EidasCycle3MatchRequestSentStateBuilderTest method build.
@Test
public void build() {
EidasCycle3MatchRequestSentState state = EidasCycle3MatchRequestSentStateBuilder.anEidasCycle3MatchRequestSentState().build();
assertThat(state.getRequestId()).isEqualTo("requestId");
assertThat(state.getIdentityProviderEntityId()).isEqualTo("identityProviderEntityId");
assertThat(state.getSessionExpiryTimestamp()).isEqualTo(DateTime.now().plusMinutes(10));
assertThat(state.getRelayState()).isEqualTo(Optional.absent());
assertThat(state.getRequestIssuerEntityId()).isEqualTo("requestIssuerId");
assertThat(state.getEncryptedIdentityAssertion()).isEqualTo("encryptedIdentityAssertion");
assertThat(state.getAssertionConsumerServiceUri()).isEqualTo(URI.create("assertionConsumerServiceUri"));
assertThat(state.getMatchingServiceAdapterEntityId()).isEqualTo("matchingServiceAdapterEntityId");
assertThat(state.getSessionId()).isEqualTo(new SessionId("sessionId"));
assertThat(state.getIdpLevelOfAssurance()).isEqualTo(LevelOfAssurance.LEVEL_2);
assertThat(state.getPersistentId()).isEqualTo(new PersistentId("default-name-id"));
assertThat(state.getTransactionSupportsEidas()).isEqualTo(true);
}
use of uk.gov.ida.hub.policy.domain.state.EidasCycle3MatchRequestSentState in project verify-hub by alphagov.
the class EidasCycle3MatchRequestSentStateBuilderTest method withEncryptedIdentityAssertion.
@Test
public void withEncryptedIdentityAssertion() {
EidasCycle3MatchRequestSentState state = EidasCycle3MatchRequestSentStateBuilder.anEidasCycle3MatchRequestSentState().withEncryptedIdentityAssertion(ENCRYPTED_DIFFERENT_IDENTITY_ASSERTION).build();
assertThat(state.getEncryptedIdentityAssertion()).isEqualTo(ENCRYPTED_DIFFERENT_IDENTITY_ASSERTION);
}
use of uk.gov.ida.hub.policy.domain.state.EidasCycle3MatchRequestSentState in project verify-hub by alphagov.
the class EidasAwaitingCycle3DataStateController method handleCycle3DataSubmitted.
@Override
public void handleCycle3DataSubmitted(final String principalIpAddressAsSeenByHub) {
getHubEventLogger().logCycle3DataObtained(getState().getSessionId(), getState().getRequestIssuerEntityId(), getState().getSessionExpiryTimestamp(), getState().getRequestId(), principalIpAddressAsSeenByHub);
EidasCycle3MatchRequestSentState eidasCycle3MatchRequestSentState = new EidasCycle3MatchRequestSentState(getState().getRequestId(), getState().getRequestIssuerEntityId(), getState().getSessionExpiryTimestamp(), getState().getAssertionConsumerServiceUri(), getState().getSessionId(), getState().getTransactionSupportsEidas(), getState().getIdentityProviderEntityId(), getState().getRelayState().orNull(), getState().getLevelOfAssurance(), getState().getMatchingServiceEntityId(), getState().getEncryptedIdentityAssertion(), getState().getPersistentId());
getStateTransitionAction().transitionTo(eidasCycle3MatchRequestSentState);
}
Aggregations