@Test
    public void testDoubleGenerateAuthenticate() {
        val generator = new JwtGenerator(new SecretSignatureConfiguration(MAC_SECRET),
            new SecretEncryptionConfiguration(MAC_SECRET));
        val profile = createProfile();
        val token = generator.generate(profile);
        Authenticator authenticator = new JwtAuthenticator(new SecretSignatureConfiguration(MAC_SECRET),
            new SecretEncryptionConfiguration(MAC_SECRET));
        val credentials = new TokenCredentials(token);
        authenticator.validate(null, credentials);
        UserProfile profile2 = (FacebookProfile) credentials.getUserProfile();
        generator.generate(profile2);
    }
This class tests the {@link JwtGenerator} and {@link JwtAuthenticator}.

@author Jerome Leleu
@since 1.8.0
pac4j-jwt/src/test/java/org/pac4j/jwt/JwtTests.java