@Test
        void verifyAccessTokenIsRefreshed() throws Throwable {
            val registeredService = getRegisteredService(UUID.randomUUID().toString(), "secret", new LinkedHashSet<>());
            registeredService.setJwtAccessToken(true);
            servicesManager.save(registeredService);
            val authentication = RegisteredServiceTestUtils.getAuthentication("casuser");

            var mv = generateAccessTokenResponseAndGetModelAndView(registeredService, authentication, OAuth20GrantTypes.AUTHORIZATION_CODE);
            assertTrue(mv.getModel().containsKey(OAuth20Constants.ACCESS_TOKEN));
            val at = mv.getModel().get(OAuth20Constants.ACCESS_TOKEN).toString();
            val decoded = oauthAccessTokenJwtCipherExecutor.decode(at).toString();
            assertNotNull(decoded);
            val jwt = JwtClaims.parse(decoded);
            assertNotNull(jwt);
            assertNotNull(jwt.getIssuedAt());
            assertNotEquals(authentication.getAuthenticationDate().toInstant().toEpochMilli(), jwt.getIssuedAt().getValueInMillis());
            assertNotNull(jwt.getExpirationTime());
            Thread.sleep(2000);
            mv = generateAccessTokenResponseAndGetModelAndView(registeredService, authentication, OAuth20GrantTypes.REFRESH_TOKEN);
            assertTrue(mv.getModel().containsKey(OAuth20Constants.ACCESS_TOKEN));
            val refreshedAt = mv.getModel().get(OAuth20Constants.ACCESS_TOKEN).toString();
            val refreshedDecoded = oauthAccessTokenJwtCipherExecutor.decode(refreshedAt).toString();
            assertNotNull(refreshedDecoded);
            val refreshedJwt = JwtClaims.parse(refreshedDecoded);
            assertNotNull(refreshedJwt);
            assertNotNull(refreshedJwt.getIssuedAt());
            assertNotEquals(authentication.getAuthenticationDate().toInstant().toEpochMilli(), refreshedJwt.getIssuedAt().getValueInMillis());
            assertNotNull(refreshedJwt.getExpirationTime());
            assertNotEquals(jwt.getExpirationTime().getValue(), refreshedJwt.getExpirationTime().getValue());
        }
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