use of uk.gov.ida.hub.policy.domain.state.EidasCycle0And1MatchRequestSentState in project verify-hub by alphagov.
the class EidasCycle0And1MatchRequestSentStateBuilderTest method withPersistentId.
@Test
public void withPersistentId() {
EidasCycle0And1MatchRequestSentState state = EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState().withPersistentId(DIFFERENT_NAME_ID).build();
assertThat(state.getPersistentId()).isEqualTo(DIFFERENT_NAME_ID);
}
use of uk.gov.ida.hub.policy.domain.state.EidasCycle0And1MatchRequestSentState in project verify-hub by alphagov.
the class EidasCycle0And1MatchRequestSentStateBuilderTest method withEncryptedIdentityAssertion.
@Test
public void withEncryptedIdentityAssertion() {
EidasCycle0And1MatchRequestSentState state = EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState().withEncryptedIdentityAssertion(ENCRYPTED_DIFFERENT_IDENTITY_ASSERTION).build();
assertThat(state.getEncryptedIdentityAssertion()).isEqualTo(ENCRYPTED_DIFFERENT_IDENTITY_ASSERTION);
}
use of uk.gov.ida.hub.policy.domain.state.EidasCycle0And1MatchRequestSentState in project verify-hub by alphagov.
the class CountrySelectedStateControllerTest method shouldTransitionToEidasCycle0And1MatchRequestSentState.
@Test
public void shouldTransitionToEidasCycle0And1MatchRequestSentState() {
final String ipAddress = "ip-address";
when(transactionsConfigProxy.getMatchingServiceEntityId(state.getRequestIssuerEntityId())).thenReturn(MSA_ID);
EidasAttributeQueryRequestDto eidasAttributeQueryRequestDto = anEidasAttributeQueryRequestDto().build();
EidasCycle0And1MatchRequestSentState eidasCycle0And1MatchRequestSentState = new EidasCycle0And1MatchRequestSentState(state.getRequestId(), state.getRequestIssuerEntityId(), state.getSessionExpiryTimestamp(), state.getAssertionConsumerServiceUri(), new SessionId(state.getSessionId().getSessionId()), state.getTransactionSupportsEidas(), COUNTRY_ENTITY_ID, state.getRelayState().orNull(), eidasAttributeQueryRequestDto.getLevelOfAssurance(), MSA_ID, eidasAttributeQueryRequestDto.getEncryptedIdentityAssertion(), eidasAttributeQueryRequestDto.getPersistentId());
controller.transitionToEidasCycle0And1MatchRequestSentState(eidasAttributeQueryRequestDto, ipAddress, COUNTRY_ENTITY_ID);
verify(hubEventLogger).logIdpAuthnSucceededEvent(state.getSessionId(), state.getSessionExpiryTimestamp(), state.getCountryEntityId(), state.getRequestIssuerEntityId(), eidasAttributeQueryRequestDto.getPersistentId(), state.getRequestId(), state.getLevelsOfAssurance().get(0), state.getLevelsOfAssurance().get(state.getLevelsOfAssurance().size() - 1), eidasAttributeQueryRequestDto.getLevelOfAssurance(), com.google.common.base.Optional.absent(), ipAddress);
verify(stateTransitionAction).transitionTo(eidasCycle0And1MatchRequestSentState);
}
use of uk.gov.ida.hub.policy.domain.state.EidasCycle0And1MatchRequestSentState in project verify-hub by alphagov.
the class EidasCycle0And1MatchRequestSentStateBuilderTest method build.
@Test
public void build() {
EidasCycle0And1MatchRequestSentState state = EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState().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);
}
Aggregations