@Test
public void verifyCompact_rfc7515TestVector_shouldThrow() throws Exception {

  String key =
      "AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow";
  // The sample token has expired since 2011-03-22.
  String compact =
      "eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9."
          + "eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ."
          + "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk";
  String algo = "HS256";
  SecretKey secretKey = new SecretKeySpec(Base64.urlSafeDecode(key), "HMAC");
  JwtHmac mac = new JwtHmac(algo, secretKey);
  JwtValidator validator = new JwtValidator.Builder().build();
  assertThrows(JwtExpiredException.class, () -> mac.verifyCompact(compact, validator));
}