@Test
    void verifyTokenChangeForIdToken() throws Throwable {
        val accessToken = getAccessToken();

        val registeredService = getOidcRegisteredService();
        val token = OAuth20TokenGeneratedResult
            .builder()
            .accessToken(accessToken)
            .refreshToken(getRefreshToken())
            .registeredService(registeredService)
            .responseType(OAuth20ResponseTypes.CODE)
            .grantType(OAuth20GrantTypes.AUTHORIZATION_CODE)
            .build();

        val request = new MockHttpServletRequest();
        val response = new MockHttpServletResponse();
        val context = new JEEContext(request, response);
        val manager = new ProfileManager(context, new JEESessionStore());

        val profile = new CommonProfile();
        profile.setClientName(Authenticators.CAS_OAUTH_CLIENT_BASIC_AUTHN);
        profile.setId("casuser");

        manager.save(true, profile, false);

        val result = OAuth20AccessTokenResponseResult.builder()
            .service(RegisteredServiceTestUtils.getService())
            .registeredService(registeredService)
            .casProperties(casProperties)
            .generatedToken(token)
            .userProfile(profile)
            .requestedTokenType(OAuth20TokenExchangeTypes.ID_TOKEN)
            .grantType(OAuth20GrantTypes.TOKEN_EXCHANGE)
            .responseType(OAuth20ResponseTypes.CODE)
            .build();

        val modelAndView = oidcAccessTokenResponseGenerator.generate(result);
        assertNotNull(modelAndView);
        val modelMap = modelAndView.getModelMap();
        assertTrue(modelMap.containsKey(OAuth20Constants.ACCESS_TOKEN));
        assertTrue(modelMap.containsKey(OAuth20Constants.TOKEN_TYPE));
        assertTrue(modelMap.containsKey(OidcConstants.ID_TOKEN));
        assertTrue(modelMap.containsKey(OAuth20Constants.ISSUED_TOKEN_TYPE));
        assertEquals(OAuth20TokenExchangeTypes.ID_TOKEN.getType(), modelMap.get(OAuth20Constants.ISSUED_TOKEN_TYPE));
    }
This is {@link OidcAccessTokenResponseGeneratorTests}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-oidc/src/test/java/org/apereo/cas/oidc/web/OidcAccessTokenResponseGeneratorTests.java