@Test
  public void authEnabledV1Auth() throws Exception {
    HiveConf hcatConf = new HiveConfForTest(this.getClass());
    hcatConf.setBoolVar(ConfVars.HIVE_AUTHORIZATION_ENABLED, true);
    hcatConf.setVar(ConfVars.HIVE_AUTHORIZATION_MANAGER, StorageBasedAuthorizationProvider.class.getName());
    SessionState.start(hcatConf);
    assertTrue("hcat auth should be enabled", HCatAuthUtil.isAuthorizationEnabled(hcatConf));
  }
Test with auth enabled and StorageBasedAuthorizationProvider
hcatalog/core/src/test/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/TestHCatAuthUtil.java