private HiveConf getHiveConf() {
    HiveConf conf = new HiveConf();
    conf.setBoolVar(HiveConf.ConfVars.HIVE_CLI_TEZ_INITIALIZE_SESSION, false);

    return conf;
  }
This unit test asserts that the record is created as expected from the various hive source objects like:
DriverContext, SessionState, QueryInfo, etc.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/queryhistory/TestQueryHistoryService.java