@Test(expected = SQLException.class)
  public void testTokenTimeout() throws Exception {
    // we set up the HS2 so that the token will expire after 5 seconds
    setupIDP(true, USER_PASS_MODE, null, "3s");
    // we add a token delay of 7 seconds
    try (HiveConnection connection = new TestHiveConnection(getSamlJdbcConnectionUrl(),
        new Properties(), USER1, USER1_PASSWORD, 7000)) {
      fail(USER1 + " logged in even after token expiry");
    }
  }
Test makes sure that the token received in the server response is not valid
after it is expired.
itests/hive-unit/src/test/java/org/apache/hive/service/auth/saml/TestHttpSamlAuthentication.java