private void setupConfigs(boolean setHadoopCredProvider, boolean setHadoopCredstorePassword,
      boolean setHiveCredPassword, boolean setHiveProviderPath) throws Exception {
    Map<String, String> mockEnv = new HashMap<>();
    // sets the env variable HADOOP_CREDSTORE_PASSWORD to value defined by HADOOP_CREDSTORE_PASSWORD
    // sets hadoop.security.credential.provider.path property to simulate default credential
    // provider setup
    if (setHadoopCredProvider) {
      jobConf.set(HADOOP_CREDENTIAL_PROVIDER_PATH_CONFIG, HADOOP_CREDSTORE_LOCATION);
    }
    if (setHadoopCredstorePassword) {
      mockEnv.put(HADOOP_CREDENTIAL_PASSWORD_ENVVAR, HADOOP_CREDSTORE_PASSWORD_ENVVAR_VAL);
    }
    // sets the env variable HIVE_JOB_CREDSTORE_PASSWORD to value defined by
    // HIVE_JOB_CREDSTORE_PASSWORD
    if (setHiveCredPassword) {
      mockEnv.put(HIVE_SERVER2_JOB_CREDSTORE_PASSWORD_ENVVAR, HIVE_JOB_CREDSTORE_PASSWORD_ENVVAR_VAL);
    }
    TestHiveCredentialProviders.setEnv(mockEnv);
    // set hive provider path in hiveConf if setHiveProviderPath is true
    // simulates hive.server2.job.credstore.location property set in hive-site.xml/core-site.xml of
    // HS2
    if (setHiveProviderPath) {
      jobConf.set(HiveConf.ConfVars.HIVE_SERVER2_JOB_CREDENTIAL_PROVIDER_PATH.varname,
          JOB_CREDSTORE_LOCATION);
    }
    jobConf.set(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE.varname, "mr");
  }
Sets up the environment and configurations

@param setHadoopCredProvider set hadoop credstore provider path
@param setHadoopCredstorePassword set HADOOP_CREDSTORE_PASSWORD env variable
@param setHiveCredPassword set HIVE_JOB_CREDSTORE_PASSWORD env variable
@param setHiveProviderPath set HiveConf.ConfVars.HIVE_SERVER2_JOB_CREDSTORE_LOCATION in the
         hive config
@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/exec/TestHiveCredentialProviders.java