@Test
    void verifyTicket() throws Throwable {
        val securityTokenTicketFactory = (SecurityTokenTicketFactory) ticketFactory.get(SecurityTokenTicket.class);
        val originalAuthn = CoreAuthenticationTestUtils.getAuthentication();
        val tgt = new TicketGrantingTicketImpl("TGT-1234567890", originalAuthn, NeverExpiresExpirationPolicy.INSTANCE);
        val token = securityTokenTicketFactory.create(tgt, "dummy-token".getBytes(StandardCharsets.UTF_8));
        assertNotNull(token);
        val serialized = ticketSerializationManager.serializeTicket(token);
        assertNotNull(serialized);
        val result = ticketSerializationManager.deserializeTicket(serialized, SecurityTokenTicket.class);
        assertNotNull(result);
        assertEquals(result, token);
    }
This is {@link DefaultSecurityTokenTicketFactoryTests}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-ws-sts/src/test/java/org/apereo/cas/ticket/DefaultSecurityTokenTicketFactoryTests.java