@Test
    public void testJsonSerializationOfOidcCredentialsWithTyping() throws Exception {
        val oidcCredentials = new OidcCredentials();
        oidcCredentials.setCode("authcode");
        oidcCredentials.setAccessToken(new BearerAccessToken("value", 0L, Scope.parse("oidc email")).toJSONObject());
        oidcCredentials.setIdToken(ID_TOKEN);
        val oidcProfile = new OidcProfile();
        oidcProfile.setId("id");
        oidcProfile.setIdTokenString(oidcCredentials.toIdToken().serialize());
        val container = new Container(oidcProfile, List.of(oidcCredentials));
        val jsonSerializer = new JsonSerializer(Container.class);
        jsonSerializer.getObjectMapper().enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
        val jsonContainer = jsonSerializer.serializeToString(container);
        val result = jsonSerializer.deserializeFromString(jsonContainer);
        assertNotNull(result);
    }
Tests {@link OidcCredentials}.

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