@Test
    public void testGenerateAuthenticateClaims() {
        val generator = new JwtGenerator(new SecretSignatureConfiguration(MAC_SECRET),
            new SecretEncryptionConfiguration(MAC_SECRET));
        final Map<String, Object> claims = new HashMap<>();
        claims.put(JwtClaims.SUBJECT, VALUE);
        val tomorrow = tomorrow();
        claims.put(JwtClaims.EXPIRATION_TIME, tomorrow);
        val token = generator.generate(claims);
        val jwtAuthenticator = new JwtAuthenticator(new SecretSignatureConfiguration(MAC_SECRET),
            new SecretEncryptionConfiguration(MAC_SECRET));
        val profile = (JwtProfile) jwtAuthenticator.validateToken(token);
        assertEquals(VALUE, profile.getSubject());
        assertEquals(tomorrow.getTime() / 1000, profile.getExpirationDate().getTime() / 1000);
        val claims2 = jwtAuthenticator.validateTokenAndGetClaims(token);
        assertEquals(VALUE, claims2.get(JwtClaims.SUBJECT));
        assertEquals(tomorrow.getTime() / 1000, ((Date) claims2.get(JwtClaims.EXPIRATION_TIME)).getTime() / 1000);
    }
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