@Test
  public void testWindowingFunction() throws Exception {

    reset(mockedAuthorizer);
    int status = driver.compile("select AVG(`i`) OVER (PARTITION BY `city`) AS iavg FROM " + tableName, true);
    assertEquals(0, status);

    List<HivePrivilegeObject> inputs = getHivePrivilegeObjectInputs().getLeft();
    checkSingleTableInput(inputs);
    HivePrivilegeObject tableObj = inputs.get(0);
    // Make sure none of the hive privilege object contain DB name with WINDOW_FUNC_PREFIX prefix.
    for (HivePrivilegeObject obj : inputs) {
      assertTrue(!obj.getDbname().startsWith(Registry.WINDOW_FUNC_PREFIX));
    }
    assertEquals("no of columns used", 2, tableObj.getColumns().size());
    assertEquals("Columns used", Arrays.asList("city", "i"), getSortedList(tableObj.getColumns()));
  }
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