@Test
    void verifyCustomScope() {
        var service = getOidcRegisteredService();
        service.getScopes().clear();
        val scopes = service.getScopes();
        scopes.addAll(List.of("cn", "mail"));
        service = (OidcRegisteredService) oidcServiceRegistryListener.postLoad(service);
        val policy = service.getAttributeReleasePolicy();
        assertInstanceOf(OidcCustomScopeAttributeReleasePolicy.class, policy);
        val custom = (OidcCustomScopeAttributeReleasePolicy) policy;
        assertTrue(scopes.containsAll(custom.getAllowedAttributes()));
    }
This is {@link OidcServiceRegistryListenerTests}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-oidc/src/test/java/org/apereo/cas/oidc/services/OidcServiceRegistryListenerTests.java