@Test
    public void testEncryptDecryptPlainJWT() throws ParseException, JOSEException {
        val config = new RSAEncryptionConfiguration(buildKeyPair());
        config.setAlgorithm(JWEAlgorithm.RSA_OAEP);
        config.setMethod(EncryptionMethod.A128GCM);

        final JWT jwt = new PlainJWT(buildClaims());
        val token = config.encrypt(jwt);
        val encryptedJwt = (EncryptedJWT) JWTParser.parse(token);
        config.decrypt(encryptedJwt);
        final JWT jwt2 = encryptedJwt;
        assertEquals(VALUE, jwt2.getJWTClaimsSet().getSubject());
    }
Tests {@link RSAEncryptionConfiguration}.

@author Jerome Leleu
@since 1.9.2
pac4j-jwt/src/test/java/org/pac4j/jwt/config/encryption/RSAEncryptionConfigurationTests.java