@RepeatedTest(2)
        void verifyAccessTokenAsJwt(final RepetitionInfo repetitionInfo) throws Throwable {
            val request = new MockHttpServletRequest();
            val profile = new CommonProfile();
            profile.setClientName("OIDC");
            profile.setId(UUID.randomUUID().toString());
            request.setAttribute(Pac4jConstants.USER_PROFILES,
                CollectionUtils.wrapLinkedHashMap(profile.getClientName(), profile));

            val accessToken = getAccessToken();
            val registeredService = getOidcRegisteredService(accessToken.getClientId());
            registeredService.setJwtAccessToken(true);
            registeredService.setIdTokenSigningAlg(AlgorithmIdentifiers.RSA_USING_SHA256);

            registeredService.setProperties(Map.of(
                RegisteredServiceProperty.RegisteredServiceProperties.ACCESS_TOKEN_AS_JWT_ENCRYPTION_ENABLED.getPropertyName(),
                new DefaultRegisteredServiceProperty("false"),
                RegisteredServiceProperty.RegisteredServiceProperties.ACCESS_TOKEN_AS_JWT_SIGNING_ENABLED.getPropertyName(),
                new DefaultRegisteredServiceProperty(repetitionInfo.getCurrentRepetition() % 2 == 0 ? "false" : "true")
            ));

            servicesManager.save(registeredService);
            val idTokenContext = IdTokenGenerationContext.builder()
                .accessToken(accessToken)
                .userProfile(profile)
                .responseType(OAuth20ResponseTypes.CODE)
                .grantType(OAuth20GrantTypes.NONE)
                .registeredService(registeredService)
                .build();
            val idToken = oidcIdTokenGenerator.generate(idTokenContext);
            assertNotNull(idToken);
            val claims = oidcTokenSigningAndEncryptionService.decode(idToken.token(), Optional.of(registeredService));
            assertNotNull(claims);
            assertTrue(claims.hasClaim(OidcConstants.CLAIM_AT_HASH));
            assertTrue(claims.hasClaim(OidcConstants.CLAIM_AUTH_TIME));
            val issuer = oidcIssuerService.determineIssuer(Optional.of(registeredService));
            assertEquals(issuer, claims.getIssuer());

            val hash = claims.getClaimValue(OidcConstants.CLAIM_AT_HASH, String.class);
            val cipher = OAuth20JwtAccessTokenEncoder.toEncodableCipher(oidcConfigurationContext,
                registeredService, accessToken, issuer);
            val encodedAccessToken = cipher.encode(accessToken.getId());
            val newHash = OAuth20TokenHashGenerator.builder()
                .token(encodedAccessToken)
                .registeredService(registeredService)
                .algorithm(registeredService.getIdTokenSigningAlg())
                .build()
                .generate();
            assertEquals(hash, newHash);
        }
This is {@link OidcIdTokenGeneratorServiceTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-oidc/src/test/java/org/apereo/cas/oidc/token/OidcIdTokenGeneratorServiceTests.java