@ParameterizedTest
    @ValueSource(strings = {
        TicketGrantingTicket.PREFIX,
        ServiceTicket.PREFIX,
        ProxyTicket.PROXY_TICKET_PREFIX,
        ProxyGrantingTicket.PROXY_GRANTING_TICKET_PREFIX
    })
    void verifyTickets(final String prefix) {
        assertFalse(redisKeyGeneratorFactory.getRedisKeyGenerators().isEmpty());
        val generator = redisKeyGeneratorFactory.getRedisKeyGenerator(prefix).orElseThrow();
        assertTrue(generator.isTicketKeyGenerator());

        val id = UUID.randomUUID().toString();
        val ticketKey = generator.forPrefixAndId(prefix, id);
        assertNotNull(ticketKey);
        assertTrue(ticketKey.startsWith(generator.getKeyspace()));
        assertTrue(ticketKey.endsWith(id));

        val rawKey = generator.rawKey(ticketKey);
        assertEquals(rawKey, id);
        assertNotNull(generator.getKeyspace());
        assertEquals(RedisKeyGenerator.REDIS_NAMESPACE_TICKETS, generator.getNamespace());
        assertThrows(IllegalArgumentException.class, () -> RedisKeyGenerator.parse(id));

        val parsed = RedisKeyGenerator.parse(ticketKey);
        assertEquals(generator.getNamespace(), parsed.getNamespace());
        assertEquals(generator.getPrefix(), parsed.getPrefix());
        assertEquals(id, parsed.getId());
    }
This is {@link DefaultRedisKeyGeneratorTests}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-redis-ticket-registry/src/test/java/org/apereo/cas/ticket/registry/key/DefaultRedisKeyGeneratorTests.java