@BeforeClass
  public static void beforeTests() throws Exception {
    createTestDir();
    createDefaultKeyStore();
    String metastorePasswd = "693efe9fa425ad21886d73a0fa3fbc70"; //random md5
    Integer webUIPort =
        MetaStoreTestUtils.findFreePortExcepting(Integer.valueOf(ConfVars.HIVE_SERVER2_WEBUI_PORT.getDefaultValue()));
    hiveConf = new HiveConf();
    hiveConf.setBoolVar(ConfVars.HIVE_SERVER2_WEBUI_USE_PAM, true);
    hiveConf.setBoolVar(ConfVars.HIVE_IN_TEST, false);
    hiveConf.set(ConfVars.METASTORE_PWD.varname, metastorePasswd);
    hiveConf.set(ConfVars.HIVE_SERVER2_WEBUI_PORT.varname, webUIPort.toString());
    hiveConf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER,
        "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
    // query history adds no value to this test, it would just bring iceberg handler dependency, which isn't worth
    hiveConf.setBoolVar(HiveConf.ConfVars.HIVE_QUERY_HISTORY_ENABLED, false);
  }
TestHS2HttpServerPamConfiguration -- checks configuration for HiveServer2 HTTP Server with Pam authentication
service/src/test/org/apache/hive/service/server/TestHS2HttpServerPamConfiguration.java