@Test
    void verifyReleaseRules() throws Throwable {
        val policy = new ReturnStaticAttributeReleasePolicy();
        policy.setAllowedAttributes(CollectionUtils.wrap("Hello", CollectionUtils.wrapList("World")));
        val principal = CoreAuthenticationTestUtils.getPrincipal("casuser",
            CollectionUtils.wrap("cn", List.of("CommonName"), "uid", List.of("casuser")));
        val registeredService = CoreAuthenticationTestUtils.getRegisteredService();
        when(registeredService.getAttributeReleasePolicy()).thenReturn(policy);

        val releasePolicyContext = RegisteredServiceAttributeReleasePolicyContext.builder()
            .registeredService(registeredService)
            .service(CoreAuthenticationTestUtils.getService())
            .applicationContext(applicationContext)
            .principal(principal)
            .build();
        val results = policy.getAttributes(releasePolicyContext);
        assertEquals(1, results.size());
        assertTrue(results.containsKey("Hello"));
        assertEquals("World", results.get("Hello").getFirst());
    }
This is {@link ReturnStaticAttributeReleasePolicyTests}.

@author Misagh Moayyed
@since 6.6.0
core/cas-server-core-authentication-attributes/src/test/java/org/apereo/cas/services/ReturnStaticAttributeReleasePolicyTests.java