@Test
  public void testTempTableImplicit() throws Exception {
    final String tableName = "testTempTableImplicit";
    driver.run("create table " + tableName + "(i int)");

    reset(mockedAuthorizer);
    int status = driver.compile("insert into " + tableName + " values (1)", true);
    assertEquals(0, status);

    List<HivePrivilegeObject> inputs = getHivePrivilegeObjectInputs().getLeft();
    List<HivePrivilegeObject> outputs = getHivePrivilegeObjectInputs().getRight();

    // only the URI should be passed for authorization check
    assertEquals("input count", 0, inputs.size());

    reset(mockedAuthorizer);
    status = driver.compile("select * from " + tableName, true);
    assertEquals(0, status);

    inputs = getHivePrivilegeObjectInputs().getLeft();
    outputs = getHivePrivilegeObjectInputs().getRight();

    // temp tables should be skipped from authorization
    assertEquals("input count", 1, inputs.size());
    assertEquals("output count", 0, outputs.size());

  }
This factory creates a mocked HiveAuthorizer class. Use the mocked class to
capture the argument passed to it in the test case.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/security/authorization/plugin/TestHiveAuthorizerCheckInvocation.java