@BeforeClass
  public static void beforeTest() throws Exception {
    conf = new HiveConfForTest(TestHivePrivilegeObjectOwnerNameAndType.class);

    // Turn on mocked authorization
    conf.setVar(ConfVars.HIVE_AUTHORIZATION_MANAGER, MockedHiveAuthorizerFactory.class.getName());
    conf.setBoolVar(ConfVars.HIVE_AUTHORIZATION_ENABLED, true);
    conf.setBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS, false);
    conf.setBoolVar(ConfVars.HIVE_SUPPORT_CONCURRENCY, true);
    conf.setVar(ConfVars.HIVE_TXN_MANAGER, DbTxnManager.class.getName());
    conf.setVar(ConfVars.HIVE_MAPRED_MODE, "nonstrict");
    conf.setVar(ConfVars.DYNAMIC_PARTITIONING_MODE, "nonstrict");

    TestTxnDbUtil.prepDb(conf);
    SessionState.start(conf);
    driver = new Driver(conf);
    runCmd("create table " + TABLE_NAME + " (i int, j int, k string) partitioned by (city string, `date` string) ");
  }
This factory creates a mocked HiveAuthorizer class. Use the mocked class to
capture the argument passed to it in the test case.
ql/src/test/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHivePrivilegeObjectOwnerNameAndType.java