@Test
  public void testAuthzSessionContextContents() throws Exception {
    driver.processCmd("show tables");
    // session string is supposed to be unique, so its got to be of some reasonable size
    assertTrue("session string size check", sessionCtx.getSessionString().length() > 10);
    assertEquals("Client type ", HiveAuthzSessionContext.CLIENT_TYPE.HIVECLI, sessionCtx.getClientType());
  }
This factory captures the HiveAuthzSessionContext argument and returns mocked
HiveAuthorizer class
itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestCLIAuthzSessionContext.java