use of org.cloudfoundry.identity.uaa.provider.oauth.OidcMetadataFetcher in project uaa by cloudfoundry.
the class LoginInfoEndpointTests method setUp.
@BeforeEach
void setUp() {
IdentityZoneHolder.clear();
marissa = new UaaPrincipal("marissa-id", "marissa", "marissa@test.org", "origin", null, IdentityZoneHolder.get().getId());
prompts = new LinkedList<>();
prompts.add(new Prompt("username", "text", "Email"));
prompts.add(new Prompt("password", "password", "Password"));
prompts.add(new Prompt("passcode", "text", "Temporary Authentication Code ( Get one at " + HTTP_LOCALHOST_8080_UAA + "/passcode )"));
mockSamlIdentityProviderConfigurator = mock(SamlIdentityProviderConfigurator.class);
when(mockSamlIdentityProviderConfigurator.getIdentityProviderDefinitions()).thenReturn(emptyList());
when(mockSamlIdentityProviderConfigurator.getIdentityProviderDefinitionsForZone(any())).thenReturn(emptyList());
mockIdentityProviderProvisioning = mock(IdentityProviderProvisioning.class);
uaaIdentityProvider = new IdentityProvider();
when(mockIdentityProviderProvisioning.retrieveByOriginIgnoreActiveFlag(eq(OriginKeys.UAA), anyString())).thenReturn(uaaIdentityProvider);
when(mockIdentityProviderProvisioning.retrieveByOrigin(eq(OriginKeys.LDAP), anyString())).thenReturn(new IdentityProvider());
idps = getIdps();
originalConfiguration = IdentityZoneHolder.get().getConfig();
OidcMetadataFetcher mockOidcMetadataFetcher = mock(OidcMetadataFetcher.class);
IdentityZoneHolder.get().setConfig(new IdentityZoneConfiguration());
configurator = new ExternalOAuthProviderConfigurator(mockIdentityProviderProvisioning, mockOidcMetadataFetcher, mock(UaaRandomStringUtil.class));
spiedMfaChecker = spy(new MfaChecker(mock(IdentityZoneProvisioning.class)));
extendedModelMap = new ExtendedModelMap();
}
Aggregations