private TokenStoreDelegationTokenSecretManager createTokenMgr(DelegationTokenStore tokenStore,
      long renewSecs, long gcTime, long maxLifeTime) {
    long secretKeyInterval =
            MetastoreConf.getTimeVar(conf, MetastoreConf.ConfVars.DELEGATION_KEY_UPDATE_INTERVAL,
                    TimeUnit.MILLISECONDS);
    long tokenMaxLifetime = maxLifeTime * 1000;
    long tokenRenewInterval = renewSecs * 1000;
    long tokenGcInterval = gcTime * 1000;
    return new TokenStoreDelegationTokenSecretManager(secretKeyInterval, tokenMaxLifetime,
        tokenRenewInterval, tokenGcInterval, tokenStore);
  }
Test the renewal of Delegation tokens obtained from the Metastore.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/security/TestTokenStoreDelegationTokenSecretManager.java