@Test
    void verifyProxyGrantingTicket() {
        val pgt = mock(Ticket.class);
        val pgtId = UUID.randomUUID().toString();
        when(pgt.getId()).thenReturn(pgtId);
        val attributes = new LinkedHashMap<String, Object>();
        attributes.put("user@name", "casuser");
        attributes.put(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET, List.of(pgtId));
        var results = encoder.encodeAttributes(Map.of(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET, pgt),
            attributes, registeredService, webApplicationService);
        assertEquals(2, results.size());
        assertTrue(results.containsKey(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET));
        assertNotEquals(pgtId, results.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET));

        when(pgt.isStateless()).thenReturn(true);
        results = encoder.encodeAttributes(Map.of(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET, pgt),
            attributes, registeredService, webApplicationService);
        assertEquals(2, results.size());
        assertTrue(results.containsKey(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET));
        assertEquals(pgtId, results.get(CasViewConstants.MODEL_ATTRIBUTE_NAME_PROXY_GRANTING_TICKET));
    }
This is {@link DefaultCasProtocolAttributeEncoderTests}.

@author Misagh Moayyed
@since 6.0.0
core/cas-server-core-services-authentication/src/test/java/org/apereo/cas/authentication/support/DefaultCasProtocolAttributeEncoderTests.java