public static void setupInternal(boolean zookeeperSSLEnabled) throws Exception {
    File zkDataDir = new File(System.getProperty("test.tmp.dir"));
    zkCluster = new MiniZooKeeperCluster(zookeeperSSLEnabled);
    int zkPort = zkCluster.startup(zkDataDir);

    miniHS2 = new MiniHS2(new HiveConfForTest(InformationSchemaWithPrivilegeTestBase.class));
    confOverlay = new HashMap<String, String>();
    Path workDir = new Path(System.getProperty("test.tmp.dir",
        "target" + File.separator + "test" + File.separator + "tmp"));
    confOverlay.put("mapred.local.dir", workDir + File.separator + "TestInformationSchemaWithPrivilege"
        + File.separator + "mapred" + File.separator + "local");
    confOverlay.put("mapred.system.dir", workDir + File.separator + "TestInformationSchemaWithPrivilege"
        + File.separator + "mapred" + File.separator + "system");
    confOverlay.put("mapreduce.jobtracker.staging.root.dir", workDir + File.separator + "TestInformationSchemaWithPrivilege"
        + File.separator + "mapred" + File.separator + "staging");
    confOverlay.put("mapred.temp.dir", workDir + File.separator + "TestInformationSchemaWithPrivilege"
        + File.separator + "mapred" + File.separator + "temp");
    confOverlay.put(ConfVars.HIVE_PRIVILEGE_SYNCHRONIZER_INTERVAL.varname, "1");
    confOverlay.put(ConfVars.HIVE_SERVER2_SUPPORT_DYNAMIC_SERVICE_DISCOVERY.varname, "true");
    confOverlay.put(ConfVars.HIVE_AUTHORIZATION_MANAGER.varname, TestHiveAuthorizerFactory.class.getName());
    confOverlay.put(ConfVars.HIVE_ZOOKEEPER_QUORUM.varname, "localhost");
    confOverlay.put(ConfVars.HIVE_ZOOKEEPER_CLIENT_PORT.varname, Integer.toString(zkPort));
    confOverlay.put(MetastoreConf.ConfVars.AUTO_CREATE_ALL.getVarname(), "true");
    confOverlay.put(ConfVars.HIVE_AUTHENTICATOR_MANAGER.varname, FakeGroupAuthenticator.class.getName());
    confOverlay.put(ConfVars.HIVE_AUTHORIZATION_ENABLED.varname, "true");
    confOverlay.put(ConfVars.HIVE_PRIVILEGE_SYNCHRONIZER.varname, "true");
    confOverlay.put(ConfVars.HIVE_AUTHORIZATION_SQL_STD_AUTH_CONFIG_WHITELIST.varname, ".*");

    if(zookeeperSSLEnabled) {
      String dataFileDir = !System.getProperty("test.data.files", "").isEmpty() ?
          System.getProperty("test.data.files") :
          (new HiveConfForTest(InformationSchemaWithPrivilegeTestBase.class)).get("test.data.files").replace('\\', '/').replace("c:", "");
      confOverlay.put(ConfVars.HIVE_ZOOKEEPER_SSL_KEYSTORE_LOCATION.varname,
          dataFileDir + File.separator + LOCALHOST_KEY_STORE_NAME);
      confOverlay.put(ConfVars.HIVE_ZOOKEEPER_SSL_KEYSTORE_PASSWORD.varname,
          KEY_STORE_TRUST_STORE_PASSWORD);
      confOverlay.put(ConfVars.HIVE_ZOOKEEPER_SSL_KEYSTORE_TYPE.varname,
          KEY_STORE_TRUST_STORE_TYPE);
      confOverlay.put(ConfVars.HIVE_ZOOKEEPER_SSL_TRUSTSTORE_LOCATION.varname,
          dataFileDir + File.separator + TRUST_STORE_NAME);
      confOverlay.put(ConfVars.HIVE_ZOOKEEPER_SSL_TRUSTSTORE_PASSWORD.varname,
          KEY_STORE_TRUST_STORE_PASSWORD);
      confOverlay.put(ConfVars.HIVE_ZOOKEEPER_SSL_TRUSTSTORE_TYPE.varname,
          KEY_STORE_TRUST_STORE_TYPE);
      confOverlay.put(ConfVars.HIVE_ZOOKEEPER_SSL_ENABLE.varname, "true");
    }
    miniHS2.start(confOverlay);

    hiveSchemaVer = MetaStoreSchemaInfoFactory.get(miniHS2.getServerConf()).getHiveSchemaVersion();
  }
Test restricted information schema with privilege synchronization
itests/hive-unit/src/test/java/org/apache/hive/service/server/InformationSchemaWithPrivilegeTestBase.java