@Test
    public void testCreateOidcProfileJwtAccessToken() throws Exception {
        when(configuration.isIncludeAccessTokenClaimsInProfile()).thenReturn(false);
        OidcClient client = new OidcClient(configuration);
        client.setAuthenticator(new OidcAuthenticator(configuration, client));
        ProfileCreator creator = new OidcProfileCreator(configuration, client);
        var webContext = MockWebContext.create();
        var credentials = new OidcCredentials();

        var accessTokenClaims = new JWTClaimsSet.Builder(idTokenClaims.toJWTClaimsSet()).claim("client", "pac4j").build();
        var accessTokenToken = new PlainJWT(accessTokenClaims);
        credentials.setAccessToken(new BearerAccessToken(accessTokenToken.serialize()).toJSONObject());

        JWT idToken = new PlainJWT(idTokenClaims.toJWTClaimsSet());
        credentials.setIdToken(idToken.serialize());
        Optional<UserProfile> profile = creator.create(new CallContext(webContext, new MockSessionStore()), credentials);
        assertTrue(profile.isPresent());
        assertNull(profile.get().getAttribute("client"));

        when(configuration.isIncludeAccessTokenClaimsInProfile()).thenReturn(true);
        profile = creator.create(new CallContext(webContext, new MockSessionStore()), credentials);
        assertTrue(profile.isPresent());
        assertEquals("pac4j", profile.get().getAttribute("client"));
    }
Tests {@link OidcProfileCreatorTests}.

@author Misagh Moayyed
@since 5.4.4
pac4j-oidc/src/test/java/org/pac4j/oidc/profile/creator/OidcProfileCreatorTests.java