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