@Test
public void verifyCompact_rfc7515TestVector_fixedClock_success() throws Exception {

  String key =
      "AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow";
  // The sample token has expired since 2011-03-22T18:43:00Z.
  String compact =
      "eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9."
          + "eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ."
          + "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk";
  String algo = "HS256";
  SecretKey secretKey = new SecretKeySpec(Base64.urlSafeDecode(key), "HMAC");
  JwtHmac mac = new JwtHmac(algo, secretKey);
  // One minute earlier than the expiration time of the sample token.
  String instant = "2011-03-22T18:42:00Z";
  Clock clock = Clock.fixed(Instant.parse(instant), ZoneOffset.UTC);
  JwtValidator validator = new JwtValidator.Builder().setClock(clock).build();
  Jwt token = mac.verifyCompact(compact, validator);
  assertThat(token.getAlgorithm()).isEqualTo(algo);
  assertThat(token.getType()).isEqualTo("JWT");
  assertThat(token.getIssuer()).isEqualTo("joe");
  boolean value = (boolean) token.getClaim("http://example.com/is_root");
  assertThat(value).isTrue();
}