@Test
public void notBeforeToken_shouldThrow() throws Exception {

  JSONObject payload = new JSONObject();
  // Set the not before time to 1 minutes in the future.
  Instant instant = Instant.now().plus(Duration.ofMinutes(1));
  payload.put(JwtNames.CLAIM_NOT_BEFORE, instant.getEpochSecond());
  Jwt notBeforeToken = new Jwt(new JSONObject(), payload, Clock.systemUTC(), Duration.ZERO);
  assertThrows(JwtNotBeforeException.class, notBeforeToken::getIssuer);
  assertThrows(JwtNotBeforeException.class, notBeforeToken::getSubject);
  assertThrows(JwtNotBeforeException.class, notBeforeToken::getAudiences);
  assertThrows(JwtNotBeforeException.class, notBeforeToken::getJwtId);
  assertThrows(JwtNotBeforeException.class, () -> notBeforeToken.getClaim("blah"));
  assertThrows(JwtNotBeforeException.class, notBeforeToken::getAlgorithm);
  assertThrows(JwtNotBeforeException.class, notBeforeToken::getType);
  assertThrows(JwtNotBeforeException.class, notBeforeToken::getContentType);
  assertThrows(JwtNotBeforeException.class, notBeforeToken::getKeyId);
}