### Question:
StandardOidcIdentityProvider implements OidcIdentityProvider { @Override public Scope getScope() { if (!isOidcEnabled()) { throw new IllegalStateException(OPEN_ID_CONNECT_SUPPORT_IS_NOT_CONFIGURED); } Scope scope = new Scope("openid", EMAIL_CLAIM); for (String additionalScope : properties.getOidcAdditionalScopes()) { scope.add(additionalScope); } return scope; } @Autowired  StandardOidcIdentityProvider(final JwtService jwtService, final NiFiRegistryProperties properties); @Override void initializeProvider(); @Override boolean isOidcEnabled(); @Override URI getAuthorizationEndpoint(); @Override URI getEndSessionEndpoint(); @Override Scope getScope(); @Override ClientID getClientId(); @Override String exchangeAuthorizationCode(final AuthorizationGrant authorizationGrant);  }### Answer:
@Test public void testValidateScopes() throws IllegalAccessException { final String additionalScope_profile = "profile"; final String additionalScope_abc = "abc"; final StandardOidcIdentityProvider provider = createOidcProviderWithAdditionalScopes(additionalScope_profile, additionalScope_abc); Scope scope = provider.getScope(); assertEquals(scope.toArray().length, 4); assertTrue(scope.contains("openid")); assertTrue(scope.contains("email")); assertTrue(scope.contains(additionalScope_profile)); assertTrue(scope.contains(additionalScope_abc)); }
@Test public void testNoDuplicatedScopes() throws IllegalAccessException { final String additionalScopeDuplicate = "abc"; final StandardOidcIdentityProvider provider = createOidcProviderWithAdditionalScopes(additionalScopeDuplicate, "def", additionalScopeDuplicate); Scope scope = provider.getScope(); assertEquals(scope.toArray().length, 4); }