<commit_before>package org.pac4j.oidc.profile;

import com.nimbusds.oauth2.sdk.Scope;
import com.nimbusds.oauth2.sdk.token.BearerAccessToken;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;
import org.pac4j.core.util.CommonHelper;

/**
 * This class tests the serialization features for the {@link OidcProfile}.
 *
 * @author <NAME>
 * @since 1.8.0
 */
public class TestOidcProfileSerialization {

    @Test
    public void testReadWriteObject() throws Exception {

        BearerAccessToken token = new BearerAccessToken(32, 128, Scope.parse("oidc email"));
        OidcProfile profile = new OidcProfile(token);
        byte[] result = SerializationUtils.serialize(profile);

        profile = (OidcProfile) SerializationUtils.deserialize(result);
        CommonHelper.assertNotNull("accessToken", profile.getAccessToken());
        CommonHelper.assertNotNull("value", profile.getAccessToken().getValue());
        CommonHelper.assertTrue(profile.getAccessToken().getLifetime() == token.getLifetime(),
                "lifetimes do not match");
        CommonHelper.assertTrue(profile.getAccessToken().getScope().equals(token.getScope()),
                "scopes do not match");

    }
}<commit_msg>Alter the test here to cover `idTokenString` as well.<commit_after>package org.pac4j.oidc.profile;

import com.nimbusds.oauth2.sdk.Scope;
import com.nimbusds.oauth2.sdk.token.BearerAccessToken;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;
import org.pac4j.core.util.CommonHelper;

/**
 * This class tests the serialization features for the {@link OidcProfile}.
 *
 * @author <NAME>
 * @since 1.8.0
 */
public class TestOidcProfileSerialization {

    @Test
    public void testReadWriteObject() throws Exception {

        String idToken = "<KEY>
        BearerAccessToken token = new BearerAccessToken(32, 128, Scope.parse("oidc email"));
        OidcProfile profile = new OidcProfile(token);
        profile.setIdTokenString(idToken);

        byte[] result = SerializationUtils.serialize(profile);

        profile = (OidcProfile) SerializationUtils.deserialize(result);
        CommonHelper.assertNotNull("accessToken", profile.getAccessToken());
        CommonHelper.assertNotNull("value", profile.getAccessToken().getValue());
        CommonHelper.assertTrue(profile.getAccessToken().getLifetime() == token.getLifetime(),
                "lifetimes do not match");
        CommonHelper.assertTrue(profile.getAccessToken().getScope().equals(token.getScope()),
                "scopes do not match");
        CommonHelper.assertTrue(idToken.equals(profile.getIdTokenString()), "id tokens do not match");

    }
}
{'fraction_non_alphanumeric': 0.11821922933034044, 'fraction_numerical': 0.009726898615787506, 'mean_word_length': 3.970260223048327, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7593362', 'n_tokens_mistral': 775, 'n_tokens_neox': 758, 'n_words': 152}