@Test
        void verifyRefreshTokenUpdatesTicketGrantingTicket() throws Throwable {
            val registeredService = getOidcRegisteredService(UUID.randomUUID().toString());
            registeredService.setSupportedGrantTypes(Set.of(OAuth20GrantTypes.REFRESH_TOKEN.getType(), OAuth20GrantTypes.AUTHORIZATION_CODE.getType()));
            registeredService.setGenerateRefreshToken(true);
            servicesManager.save(registeredService);

            val expirationPolicy = new TimeoutExpirationPolicy(2);
            val ticketGrantingTicket = new TicketGrantingTicketImpl(UUID.randomUUID().toString(),
                RegisteredServiceTestUtils.getAuthentication(), expirationPolicy);
            val expirationTime = expirationPolicy.getIdleExpirationTime(ticketGrantingTicket);
            val lastTimeUsed = ticketGrantingTicket.getLastTimeUsed();
            
            ticketRegistry.addTicket(ticketGrantingTicket);
            val code = addCode(ticketGrantingTicket, registeredService);
            val result = mvc.perform(post("/cas/" + OidcConstants.BASE_OIDC_URL + '/' + OidcConstants.TOKEN_URL)
                    .secure(true)
                    .param(OAuth20Constants.CLIENT_ID, registeredService.getClientId())
                    .param(OAuth20Constants.CLIENT_SECRET, registeredService.getClientSecret())
                    .queryParam(OAuth20Constants.SCOPE, OidcConstants.StandardScopes.OPENID.getScope())
                    .queryParam(OAuth20Constants.CODE, code.getId())
                    .queryParam(OAuth20Constants.REDIRECT_URI, "https://oauth.example.org")
                    .queryParam(OAuth20Constants.GRANT_TYPE, OAuth20GrantTypes.AUTHORIZATION_CODE.getType()))
                .andExpect(status().isOk())
                .andExpect(jsonPath("$.id_token").exists())
                .andExpect(jsonPath("$.access_token").exists())
                .andExpect(jsonPath("$.refresh_token").exists())
                .andReturn();

            val refreshToken = result.getModelAndView().getModel().get(OAuth20Constants.REFRESH_TOKEN).toString();
            val auth = EncodingUtils.encodeBase64(registeredService.getClientId() + ':' + registeredService.getClientSecret());

            for (var i = 0; i < 5; i++) {
                mvc.perform(post("/cas/" + OidcConstants.BASE_OIDC_URL + '/' + OidcConstants.TOKEN_URL)
                        .secure(true)
                        .header(HttpHeaders.AUTHORIZATION, "Basic " + auth)
                        .param(OAuth20Constants.CLIENT_ID, registeredService.getClientId())
                        .param(OAuth20Constants.CLIENT_SECRET, registeredService.getClientSecret())
                        .queryParam(OAuth20Constants.SCOPE, OidcConstants.StandardScopes.OPENID.getScope())
                        .queryParam(OAuth20Constants.REFRESH_TOKEN, refreshToken)
                        .queryParam(OAuth20Constants.GRANT_TYPE, OAuth20GrantTypes.REFRESH_TOKEN.getType()))
                    .andExpect(status().isOk())
                    .andExpect(jsonPath("$.id_token").exists())
                    .andExpect(jsonPath("$.access_token").exists());
                Thread.sleep(1000);
            }
            val tgt = ticketRegistry.getTicket(ticketGrantingTicket.getId(), TicketGrantingTicket.class);
            assertNotNull(tgt);
            val updatedExpirationTime = expirationPolicy.getIdleExpirationTime(tgt);
            val updatedLastTimeUsed = tgt.getLastTimeUsed();
            assertTrue(updatedExpirationTime.isAfter(expirationTime));
            assertTrue(updatedLastTimeUsed.isAfter(lastTimeUsed));
        }
This is {@link OidcAccessTokenEndpointControllerTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-oidc/src/test/java/org/apereo/cas/oidc/web/controllers/token/OidcAccessTokenEndpointControllerTests.java