@Test
    void verifyTgtIsExpired() throws Exception {
        val context = MockRequestContext.create(applicationContext);
        val svc = RegisteredServiceTestUtils.getRegisteredService(UUID.randomUUID().toString(), Map.of());
        val strategy = getSingleSignOnStrategy(svc);

        WebUtils.putServiceIntoFlowScope(context, RegisteredServiceTestUtils.getService(svc.getServiceId()));
        val authentication = CoreAuthenticationTestUtils.getAuthentication(Map.of());
        val tgt = new MockTicketGrantingTicket(authentication);
        tgt.markTicketExpired();
        ticketRegistry.addTicket(tgt);
        WebUtils.putTicketGrantingTicketInScopes(context, tgt);

        val ssoRequest = SingleSignOnParticipationRequest.builder()
            .httpServletRequest(context.getHttpServletRequest())
            .httpServletResponse(context.getHttpServletResponse())
            .requestContext(context)
            .build();
        assertTrue(strategy.supports(ssoRequest));
        assertThrows(InvalidTicketException.class, () -> strategy.isParticipating(ssoRequest));
    }
This is {@link DelegatedAuthenticationSingleSignOnParticipationStrategyTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-pac4j-core/src/test/java/org/apereo/cas/web/flow/DelegatedAuthenticationSingleSignOnParticipationStrategyTests.java