@Test
    void verifyReleaseProxyGrantingTicket() {
        val policy = new DefaultAuthenticationAttributeReleasePolicy(
            Set.of(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET),
            Set.of(), "authnContext");
        val service = CoreAuthenticationTestUtils.getRegisteredService();
        val attrPolicy = new ReturnAllowedAttributeReleasePolicy();
        when(service.getAttributeReleasePolicy()).thenReturn(attrPolicy);
        val authentication = CoreAuthenticationTestUtils.getAuthentication(CoreAuthenticationTestUtils.getPrincipal());
        var results = policy.getAuthenticationAttributesForRelease(authentication, mock(Assertion.class), Map.of(), service);
        assertTrue(results.isEmpty());
        attrPolicy.setAuthorizedToReleaseProxyGrantingTicket(true);
        val pgt = mock(Ticket.class);
        val pgtId = UUID.randomUUID().toString();
        when(pgt.getId()).thenReturn(pgtId);
        results = policy.getAuthenticationAttributesForRelease(
            authentication, mock(Assertion.class),
            Map.of(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET, pgt), service);
        assertEquals(1, results.size());
        assertTrue(results.containsKey(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET));
    }
This is {@link DefaultAuthenticationAttributeReleasePolicyTests}.

@author Misagh Moayyed
@since 6.3.0
core/cas-server-core-authentication-attributes/src/test/java/org/apereo/cas/authentication/DefaultAuthenticationAttributeReleasePolicyTests.java