@Test
    void verifyOperation() throws Throwable {
        val policy = new OidcCustomScopeAttributeReleasePolicy("groups", CollectionUtils.wrap("groups"));
        assertEquals(OidcConstants.CUSTOM_SCOPE_TYPE, policy.getScopeType());
        assertNotNull(policy.getAllowedAttributes());
        val principal = CoreAuthenticationTestUtils.getPrincipal(UUID.randomUUID().toString(),
            CollectionUtils.wrap("groups", List.of("admin", "user")));
        val releasePolicyContext = RegisteredServiceAttributeReleasePolicyContext.builder()
            .registeredService(CoreAuthenticationTestUtils.getRegisteredService())
            .service(CoreAuthenticationTestUtils.getService())
            .applicationContext(applicationContext)
            .principal(principal)
            .build();
        val attrs = policy.getAttributes(releasePolicyContext);
        assertTrue(policy.getAllowedAttributes().stream().allMatch(attrs::containsKey));
        val principal2 = CoreAuthenticationTestUtils.getPrincipal(attrs);

        val releasePolicyContext2 = RegisteredServiceAttributeReleasePolicyContext.builder()
            .registeredService(CoreAuthenticationTestUtils.getRegisteredService())
            .service(CoreAuthenticationTestUtils.getService())
            .principal(principal2)
            .applicationContext(applicationContext)
            .build();
        val releaseAttrs = policy.getAttributes(releasePolicyContext2);
        assertTrue(policy.getAllowedAttributes().stream().allMatch(releaseAttrs::containsKey));
        assertTrue(policy.getAllowedAttributes().containsAll(policy.determineRequestedAttributeDefinitions(releasePolicyContext2)));
        assertEquals(List.of("admin", "user"), releaseAttrs.get("groups"));
    }
This is {@link OidcCustomScopeAttributeReleasePolicyTests}.

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