@Test
  public void testHiveHistoryConfigDisabled() throws Exception {
    HiveConf conf = getHiveConf();
    conf.setBoolVar(ConfVars.HIVE_SESSION_HISTORY_ENABLED, false);
    SessionState ss = new CliSessionState(conf);
    SessionState.start(ss);
    HiveHistory hHistory = ss.getHiveHistory();
    assertTrue("checking hive history class when history is disabled",
        hHistory.getClass() != HiveHistoryImpl.class);
    System.err.println("hHistory.getClass" + hHistory.getClass());
    assertTrue("verifying proxy class is used when history is disabled",
        Proxy.isProxyClass(hHistory.getClass()));

  }
Check if HiveHistory class is a Proxy class when hive history is disabled
@throws Exception
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/history/TestHiveHistory.java