private HiveConf getAuthV2HiveConf() {
    HiveConf conf = new HiveConfForTest(getClass());
    conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER,
        HiveAuthorizerStoringUserNameFactory.class.getName());
    conf.setVar(HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER,
        SessionStateUserAuthenticator.class.getName());
    return conf;
  }
@return HiveConf with authorization V2 enabled with a dummy authorization factory
that captures the given user name
ql/src/test/org/apache/hadoop/hive/ql/parse/authorization/TestSessionUserName.java