Search in sources :

Example 1 with EidasSuccessfulMatchState

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

the class EidasCycle0And1MatchRequestSentStateControllerTest method shouldReturnSuccessfulMatchState.

@Test
public void shouldReturnSuccessfulMatchState() {
    MatchFromMatchingService matchFromMatchingService = new MatchFromMatchingService("issuer", "inResponseTo", "matchingServiceAssertion", Optional.of(LevelOfAssurance.LEVEL_2));
    doNothing().when(hubEventLogger).logCycle01SuccessfulMatchEvent(state.getSessionId(), state.getRequestIssuerEntityId(), state.getRequestId(), state.getSessionExpiryTimestamp());
    EidasSuccessfulMatchState expectedState = new EidasSuccessfulMatchState(state.getRequestId(), state.getSessionExpiryTimestamp(), state.getIdentityProviderEntityId(), matchFromMatchingService.getMatchingServiceAssertion(), state.getRelayState().orNull(), state.getRequestIssuerEntityId(), state.getAssertionConsumerServiceUri(), state.getSessionId(), state.getIdpLevelOfAssurance(), state.getTransactionSupportsEidas());
    State actualState = eidasCycle0And1MatchRequestSentStateController.getNextStateForMatch(matchFromMatchingService);
    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) MatchFromMatchingService(uk.gov.ida.hub.policy.domain.MatchFromMatchingService) EidasSuccessfulMatchState(uk.gov.ida.hub.policy.domain.state.EidasSuccessfulMatchState) Test(org.junit.Test)

Example 2 with EidasSuccessfulMatchState

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

the class TestSessionResourceHelper method createSessionInEidasSuccessfulMatchState.

public static Response createSessionInEidasSuccessfulMatchState(SessionId sessionId, String rpEntityId, String countryEntityId, Client client, URI uri) {
    EidasSuccessfulMatchState eidasSuccessfulMatchState = aEidasSuccessfulMatchState().withRequestIssuerId(rpEntityId).withSessionId(sessionId).withIdentityProviderEntityId(countryEntityId).build();
    TestSessionDto testSessionDto = createASuccessfulMatchStateTestSessionDto(eidasSuccessfulMatchState, sessionId);
    return client.target(uri).request(MediaType.APPLICATION_JSON_TYPE).post(Entity.json(testSessionDto));
}
Also used : EidasSuccessfulMatchState(uk.gov.ida.hub.policy.domain.state.EidasSuccessfulMatchState) EidasSuccessfulMatchStateBuilder.aEidasSuccessfulMatchState(uk.gov.ida.hub.policy.builder.state.EidasSuccessfulMatchStateBuilder.aEidasSuccessfulMatchState)

Aggregations

EidasSuccessfulMatchState (uk.gov.ida.hub.policy.domain.state.EidasSuccessfulMatchState)2 Test (org.junit.Test)1 EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState (uk.gov.ida.hub.policy.builder.state.EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState)1 EidasSuccessfulMatchStateBuilder.aEidasSuccessfulMatchState (uk.gov.ida.hub.policy.builder.state.EidasSuccessfulMatchStateBuilder.aEidasSuccessfulMatchState)1 MatchFromMatchingService (uk.gov.ida.hub.policy.domain.MatchFromMatchingService)1 State (uk.gov.ida.hub.policy.domain.State)1 EidasAwaitingCycle3DataState (uk.gov.ida.hub.policy.domain.state.EidasAwaitingCycle3DataState)1 EidasCycle0And1MatchRequestSentState (uk.gov.ida.hub.policy.domain.state.EidasCycle0And1MatchRequestSentState)1 NoMatchState (uk.gov.ida.hub.policy.domain.state.NoMatchState)1