@Test
    void verifyExpirationPolicyPerAuthenticationAsDuration() throws Throwable {
        val registeredService = RegisteredServiceTestUtils.getRegisteredService("durationTgtExpirationPolicy", CasRegisteredService.class);
        servicesManager.save(registeredService);
        val factory = (TicketGrantingTicketFactory) ticketFactory.get(TicketGrantingTicket.class);
        val authentication = RegisteredServiceTestUtils.getAuthentication("casuser",
            Map.of(AuthenticationManager.AUTHENTICATION_SESSION_TIMEOUT_ATTRIBUTE, List.of("PT10S")));
        val tgt = factory.create(authentication, RegisteredServiceTestUtils.getService(registeredService.getServiceId()));
        assertEquals(10, tgt.getExpirationPolicy().getTimeToLive());
    }
This is {@link DefaultTicketGrantingTicketFactoryTests}.

@author Misagh Moayyed
@since 6.3.0
core/cas-server-core-tickets/src/test/java/org/apereo/cas/ticket/factory/DefaultTicketGrantingTicketFactoryTests.java