@Test
        void verifyTicketGrantingTicketUpdated() throws Throwable {
            val registeredService = getRegisteredService(SERVICE_URL, UUID.randomUUID().toString(), "secret");
            servicesManager.save(registeredService);
            val authentication = RegisteredServiceTestUtils.getAuthentication(UUID.randomUUID().toString());
            val service = RegisteredServiceTestUtils.getService(SERVICE_URL);
            val mockResponse = new MockHttpServletResponse();
            val mockRequest = new MockHttpServletRequest(HttpMethod.GET.name(), CONTEXT + OAuth20Constants.ACCESS_TOKEN_URL);
            val webContext = new JEEContext(mockRequest, mockResponse);
            val ticketGrantingTicket = new TicketGrantingTicketImpl(UUID.randomUUID().toString(), authentication,
                new TimeoutExpirationPolicy(5));
            val lastUsedTime = ticketGrantingTicket.getLastTimeUsed();
            val tokenRequestContext = buildAccessTokenRequestContext(registeredService, authentication,
                OAuth20GrantTypes.AUTHORIZATION_CODE, service, ticketGrantingTicket, webContext);

            val result = oauthTokenGenerator.generate(tokenRequestContext);
            val accessToken = result.getAccessToken().map(OAuth20AccessToken.class::cast).orElseThrow();
            assertNotNull(accessToken.getTicketGrantingTicket());
            assertTrue(accessToken.getTicketGrantingTicket().getLastTimeUsed().isAfter(lastUsedTime));
        }
This is {@link OAuth20DefaultTokenGeneratorTests}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-oauth/src/test/java/org/apereo/cas/support/oauth/web/response/accesstoken/OAuth20DefaultTokenGeneratorTests.java