Search in sources :

Example 6 with IdpConfigDto

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

the class SessionStartedStateControllerTest method setup.

@Before
public void setup() {
    sessionStartedState = aSessionStartedState().withTransactionSupportsEidas(true).build();
    when(transactionsConfigProxy.getLevelsOfAssurance(sessionStartedState.getRequestIssuerEntityId())).thenReturn(asList(LevelOfAssurance.LEVEL_1, LevelOfAssurance.LEVEL_2));
    IdpConfigDto idpConfigDto = new IdpConfigDto(IDP_ENTITY_ID, true, ImmutableList.of(LevelOfAssurance.LEVEL_2, LevelOfAssurance.LEVEL_1));
    when(identityProvidersConfigProxy.getIdpConfig(IDP_ENTITY_ID)).thenReturn(idpConfigDto);
    when(identityProvidersConfigProxy.getEnabledIdentityProviders(sessionStartedState.getRequestIssuerEntityId(), REGISTERING, LevelOfAssurance.LEVEL_2)).thenReturn(singletonList(IDP_ENTITY_ID));
    controller = new SessionStartedStateController(sessionStartedState, hubEventLogger, stateTransitionAction, transactionsConfigProxy, responseFromHubFactory, identityProvidersConfigProxy);
}
Also used : IdpConfigDto(uk.gov.ida.hub.policy.domain.IdpConfigDto) Before(org.junit.Before)

Example 7 with IdpConfigDto

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

the class AuthnFailedErrorStateControllerTest method setup.

@Before
public void setup() {
    authnFailedErrorState = anAuthnFailedErrorState().withTransactionSupportsEidas(true).build();
    when(transactionsConfigProxy.getLevelsOfAssurance(authnFailedErrorState.getRequestIssuerEntityId())).thenReturn(asList(LevelOfAssurance.LEVEL_1, LevelOfAssurance.LEVEL_2));
    IdpConfigDto idpConfigDto = new IdpConfigDto(IDP_ENTITY_ID, true, asList(LevelOfAssurance.LEVEL_1, LevelOfAssurance.LEVEL_2));
    when(identityProvidersConfigProxy.getIdpConfig(IDP_ENTITY_ID)).thenReturn(idpConfigDto);
    when(identityProvidersConfigProxy.getEnabledIdentityProviders(authnFailedErrorState.getRequestIssuerEntityId(), REGISTERING, LevelOfAssurance.LEVEL_2)).thenReturn(singletonList(IDP_ENTITY_ID));
    controller = new AuthnFailedErrorStateController(authnFailedErrorState, responseFromHubFactory, stateTransitionAction, transactionsConfigProxy, identityProvidersConfigProxy, hubEventLogger);
}
Also used : IdpConfigDto(uk.gov.ida.hub.policy.domain.IdpConfigDto) Before(org.junit.Before)

Aggregations

IdpConfigDto (uk.gov.ida.hub.policy.domain.IdpConfigDto)7 IdpSelectedState (uk.gov.ida.hub.policy.domain.state.IdpSelectedState)4 Before (org.junit.Before)3 Test (org.junit.Test)3 LevelOfAssurance (uk.gov.ida.hub.policy.domain.LevelOfAssurance)1