Search in sources :

Example 6 with NoMatchState

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

the class EidasCycle0And1MatchRequestSentStateControllerTest method shouldReturnNoMatchState.

@Test
public void shouldReturnNoMatchState() {
    when(transactionsConfigProxy.getMatchingProcess(state.getRequestIssuerEntityId())).thenReturn(new MatchingProcess(Optional.absent()));
    doNothing().when(hubEventLogger).logCycle01NoMatchEvent(state.getSessionId(), state.getRequestIssuerEntityId(), state.getRequestId(), state.getSessionExpiryTimestamp());
    NoMatchState expectedState = new NoMatchState(state.getRequestId(), state.getIdentityProviderEntityId(), state.getRequestIssuerEntityId(), state.getSessionExpiryTimestamp(), state.getAssertionConsumerServiceUri(), state.getRelayState(), state.getSessionId(), state.getTransactionSupportsEidas());
    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) MatchingProcess(uk.gov.ida.hub.policy.domain.MatchingProcess) NoMatchState(uk.gov.ida.hub.policy.domain.state.NoMatchState) Test(org.junit.Test)

Example 7 with NoMatchState

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

the class ErrorStateControllerTests method shouldReturnErrorResponseWhenAskedAndInNoMatchState.

@Test
public void shouldReturnErrorResponseWhenAskedAndInNoMatchState() {
    NoMatchState state = NoMatchStateBuilder.aNoMatchState().build();
    StateController stateController = new NoMatchStateController(state, responseFromHubFactory);
    when(sessionRepository.getStateController(sessionId, ErrorResponsePreparedState.class)).thenReturn(stateController);
    ResponseFromHub responseFromHub = authnRequestFromTransactionHandler.getErrorResponseFromHub(sessionId);
    assertThat(responseFromHub.getStatus()).isEqualTo(TransactionIdaStatus.NoAuthenticationContext);
}
Also used : StateController(uk.gov.ida.hub.policy.domain.StateController) NoMatchState(uk.gov.ida.hub.policy.domain.state.NoMatchState) ResponseFromHub(uk.gov.ida.hub.policy.domain.ResponseFromHub) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 NoMatchState (uk.gov.ida.hub.policy.domain.state.NoMatchState)7 MatchingProcess (uk.gov.ida.hub.policy.domain.MatchingProcess)2 NoMatchFromMatchingService (uk.gov.ida.hub.policy.domain.NoMatchFromMatchingService)2 ResponseProcessingDetails (uk.gov.ida.hub.policy.domain.ResponseProcessingDetails)2 SessionId (uk.gov.ida.hub.policy.domain.SessionId)2 Matchers.anyString (org.mockito.Matchers.anyString)1 Cycle3MatchRequestSentStateBuilder.aCycle3MatchRequestSentState (uk.gov.ida.hub.policy.builder.state.Cycle3MatchRequestSentStateBuilder.aCycle3MatchRequestSentState)1 EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState (uk.gov.ida.hub.policy.builder.state.EidasCycle0And1MatchRequestSentStateBuilder.anEidasCycle0And1MatchRequestSentState)1 ResponseFromHub (uk.gov.ida.hub.policy.domain.ResponseFromHub)1 State (uk.gov.ida.hub.policy.domain.State)1 StateController (uk.gov.ida.hub.policy.domain.StateController)1 Cycle3MatchRequestSentState (uk.gov.ida.hub.policy.domain.state.Cycle3MatchRequestSentState)1 EidasAwaitingCycle3DataState (uk.gov.ida.hub.policy.domain.state.EidasAwaitingCycle3DataState)1 EidasCycle0And1MatchRequestSentState (uk.gov.ida.hub.policy.domain.state.EidasCycle0And1MatchRequestSentState)1 EidasSuccessfulMatchState (uk.gov.ida.hub.policy.domain.state.EidasSuccessfulMatchState)1