@RepeatedTest(2)
    void verifyStatelessTickets() throws Exception {
        val expirationPolicy = new RememberMeDelegatingExpirationPolicy()
            .addPolicy(RememberMeDelegatingExpirationPolicy.POLICY_NAME_REMEMBER_ME,
                new TicketGrantingTicketExpirationPolicy(60000, 2000))
            .addPolicy(BaseDelegatingExpirationPolicy.POLICY_NAME_DEFAULT,
                new TicketGrantingTicketExpirationPolicy(2000, 2000));

        val attributes = new HashMap<String, List<Object>>();
        IntStream.rangeClosed(1, 10).forEach(i -> attributes.put(RandomUtils.randomAlphabetic(1), List.of(RandomUtils.randomAlphabetic(10))));

        val principal = RegisteredServiceTestUtils.getPrincipal(UUID.randomUUID().toString(), attributes);
        val originalAuthn = RegisteredServiceTestUtils.getAuthentication(principal, attributes);

        val ticketGrantingTicketId = TestTicketIdentifiers.generate().ticketGrantingTicketId();
        val tgt = new TicketGrantingTicketImpl(ticketGrantingTicketId, originalAuthn, expirationPolicy);
        val addedTicketGrantingTicket = newTicketRegistry.addTicket(tgt);
        assertNotNull(addedTicketGrantingTicket.getExpirationPolicy());
        assertTrue(addedTicketGrantingTicket.isStateless());
        val foundTicketGrantingTicket = newTicketRegistry.getTicket(addedTicketGrantingTicket.getId());
        assertNotNull(foundTicketGrantingTicket);
        assertEquals(tgt, foundTicketGrantingTicket);

        val service = RegisteredServiceTestUtils.getService("https://apereo.github.io/cas");
        service.getAttributes().putAll(attributes);
        servicesManager.save(RegisteredServiceTestUtils.getRegisteredService(service.getId()));

        val serviceTicket = tgt.grantServiceTicket(UUID.randomUUID().toString(),
            service,
            new MultiTimeUseOrTimeoutExpirationPolicy.ServiceTicketExpirationPolicy(1, 100),
            true, TicketTrackingPolicy.noOp());
        val addedServiceTicket = newTicketRegistry.addTicket(serviceTicket);
        assertTrue(addedServiceTicket.isStateless());

        val retrievedTicket = (RenewableServiceTicket) newTicketRegistry.getTicket(addedServiceTicket.getId());
        assertNotNull(retrievedTicket);
        assertTrue(retrievedTicket.isStateless());
        assertTrue(retrievedTicket.isFromNewLogin());
        assertEquals(serviceTicket.getAuthentication().getPrincipal(), ((AuthenticationAwareTicket) retrievedTicket).getAuthentication().getPrincipal());
    }
This is {@link StatelessTicketRegistryTests}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-stateless-ticket-registry/src/test/java/org/apereo/cas/ticket/registry/StatelessTicketRegistryTests.java