@Test
    public void testSerialization() throws ParseException {
        val credentials = new OidcCredentials();
        credentials.setCode(VALUE);
        credentials.setAccessToken(new BearerAccessToken(VALUE, 0L, Scope.parse("oidc email")).toJSONObject());
        credentials.setRefreshToken(new RefreshToken(VALUE).toJSONObject());
        credentials.setIdToken(ID_TOKEN);
        var result = serializer.serializeToBytes(credentials);
        val credentials2 = (OidcCredentials) serializer.deserializeFromBytes(result);
        assertEquals(credentials.getAccessToken(), credentials2.getAccessToken());
        assertEquals(credentials.getRefreshToken(), credentials2.getRefreshToken());
        assertEquals(credentials.toIdToken().getParsedString(), credentials2.toIdToken().getParsedString());
    }
Tests {@link OidcCredentials}.

@author Jerome Leleu
@since 1.9.2
pac4j-oidc/src/test/java/org/pac4j/oidc/credentials/OidcCredentialsTests.java