@Test
    void verifyAttributeRelease() throws Throwable {
        val service = RegisteredServiceTestUtils.getRegisteredService("verifyAttributeRelease");
        val policy = new WSFederationClaimsReleasePolicy(
            CollectionUtils.wrap(WSFederationClaims.COMMON_NAME.name(), "cn",
                WSFederationClaims.EMAIL_ADDRESS.name(), "email",
                WSFederationClaims.GROUP.name(), "unknown",
                WSFederationClaims.EMAIL_ADDRESS_2005.name(), "unknown"));
        assertFalse(policy.getAllowedAttributes().isEmpty());
        val principal = CoreAuthenticationTestUtils.getPrincipal("casuser",
            CollectionUtils.wrap("cn", "casuser", "email", "cas@example.org",
                WSFederationClaims.EMAIL_ADDRESS_2005.getUri(), "cas2005@example.org"));

        val releasePolicyContext = RegisteredServiceAttributeReleasePolicyContext.builder()
            .registeredService(service)
            .applicationContext(applicationContext)
            .service(CoreAuthenticationTestUtils.getService())
            .principal(principal)
            .build();
        val results = policy.getAttributes(releasePolicyContext);
        assertSame(3, results.size());
        assertTrue(results.containsKey(WSFederationClaims.COMMON_NAME.getUri()));
        assertTrue(results.containsKey(WSFederationClaims.EMAIL_ADDRESS.getUri()));
        assertTrue(results.containsKey(WSFederationClaims.EMAIL_ADDRESS_2005.getUri()));
        
        val commonNameValue = results.get(WSFederationClaims.COMMON_NAME.getUri());
        assertEquals(CollectionUtils.wrapArrayList("casuser"), commonNameValue);
        val emailAddressValue = results.get(WSFederationClaims.EMAIL_ADDRESS.getUri());
        assertEquals(CollectionUtils.wrapArrayList("cas@example.org"), emailAddressValue);
    }
This is {@link WSFederationClaimsReleasePolicyTests}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-ws-idp-api/src/test/java/org/apereo/cas/ws/idp/services/WSFederationClaimsReleasePolicyTests.java