@Test
        void verifyJwtAccessTokenOperation() throws Throwable {
            val registeredService = getOidcRegisteredService("ES512");
            registeredService.setIdTokenSigningAlg(AlgorithmIdentifiers.ECDSA_USING_P521_CURVE_AND_SHA512);
            registeredService.setJwksKeyId("EC");
            registeredService.setJwtAccessToken(true);
            registeredService.setJwtAccessTokenSigningAlg(AlgorithmIdentifiers.ECDSA_USING_P521_CURVE_AND_SHA512);
            registeredService.setEncryptIdToken(false);

            val accessTokenContext = AccessTokenRequestContext.builder()
                .grantType(OAuth20GrantTypes.AUTHORIZATION_CODE)
                .responseType(OAuth20ResponseTypes.NONE)
                .registeredService(registeredService)
                .generateRefreshToken(true)
                .service(RegisteredServiceTestUtils.getService(registeredService.getServiceId()))
                .authentication(RegisteredServiceTestUtils.getAuthentication(UUID.randomUUID().toString()))
                .scopes(Set.of(OidcConstants.StandardScopes.OPENID.getScope()))
                .build();
            val accessTokenResult = oauthTokenGenerator.generate(accessTokenContext);
            assertNotNull(accessTokenResult);

            val encodedModelAndView = new OAuth20AccessTokenResponseEncoder(oidcConfigurationContext)
                .encode(accessTokenContext, accessTokenResult);
            assertNotNull(encodedModelAndView);
            val accessToken = (String) encodedModelAndView.getModel().get(OAuth20Constants.ACCESS_TOKEN);
            val header = (JWSHeader) JwtBuilder.parseHeader(accessToken);
            assertNotNull(header);
            assertEquals(registeredService.getJwtAccessTokenSigningAlg(), header.getAlgorithm().getName());
            assertEquals(registeredService.getJwksKeyId(), header.getKeyID());
        }
This is {@link OidcIdTokenSigningAndEncryptionServiceTests}.

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