    @Test(expected = PrematureJWTException.class)
    public void shouldNotParse_hmac_prematureToken() throws Exception {

        SecureRandom random = new SecureRandom();
        byte[] sharedSecret = new byte[32];
        random.nextBytes(sharedSecret);
        SecretKeySpec secretKeySpec = new SecretKeySpec(sharedSecret, SignatureAlgorithm.HS256.getJcaName());
        JWTBuilder jwtBuilder  = new DefaultJWTBuilder(secretKeySpec, SignatureAlgorithm.HS256.getValue(), "123");
        JWTParser jwtParser = new DefaultJWTParser(secretKeySpec);

        JWT jwt = new JWT();
        jwt.setIss("https://gravitee.io");
        jwt.setSub("alice");
        jwt.setNbf(Instant.now().plus(60, ChronoUnit.MINUTES).getEpochSecond());
        jwt.setExp(Instant.now().plus(60, ChronoUnit.MINUTES).getEpochSecond());
        String signedJWT = jwtBuilder.sign(jwt);

        jwtParser.parse(signedJWT);
    }