@RepeatedTest(2)
    @Transactional(transactionManager = "ticketTransactionManager", readOnly = false)
    void verifyTicketsWithAuthnAttributes() throws Throwable {
        assumeTrue(canTicketRegistryIterate());
        val authn = CoreAuthenticationTestUtils.getAuthentication(
            Map.of("cn", List.of("cn1", "cn2"), "givenName", List.of("g1", "g2"),
                "authn-context", List.of("mfa-example")));
        val tgt1 = new TicketGrantingTicketImpl(TestTicketIdentifiers.generate().ticketGrantingTicketId(),
            authn, NeverExpiresExpirationPolicy.INSTANCE);
        ticketRegistry.addTicket(tgt1);

        val tgt2 = new TicketGrantingTicketImpl(TICKET_GRANTING_TICKET_ID_GENERATOR.getNewTicketId(TicketGrantingTicket.PREFIX),
            CoreAuthenticationTestUtils.getAuthentication(), NeverExpiresExpirationPolicy.INSTANCE);
        ticketRegistry.addTicket(tgt2);

        val queryAttributes = Map.<String, List<Object>>of("cn", List.of("cn2", "cn1000"),
            "authn-context", List.of("mfa-example", "mfa-one"));
        val tickets = ticketRegistry.getSessionsWithAttributes(queryAttributes).toList();
        assertEquals(1, tickets.size());
        assertTrue(tickets.contains(tgt1));
    }
This is {@link BaseTicketRegistryTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-tickets/src/test/java/org/apereo/cas/ticket/registry/BaseTicketRegistryTests.java