@RepeatedTest(2)
    void verifyUnableToAddExpiredTicket() {
        val originalAuthn = CoreAuthenticationTestUtils.getAuthentication();
        val ticketGrantingTicketId = TestTicketIdentifiers.generate().ticketGrantingTicketId();
        val s1 = Stream.of(new TicketGrantingTicketImpl(ticketGrantingTicketId,
            originalAuthn, AlwaysExpiresExpirationPolicy.INSTANCE));
        ticketRegistry.addTicket(s1);
        assertThrows(InvalidTicketException.class, () -> ticketRegistry.getTicket(ticketGrantingTicketId, TicketGrantingTicket.class));
    }
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