@Test
  public void testDoAsSetting(){

    HiveConf hconf = new HiveConf();
    hconf
    .setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER,
        "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
    assertTrue("default value of hive server2 doAs should be true",
        hconf.getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS));


    CLIService cliService = new CLIService(null, true);
    cliService.init(hconf);
    ThriftCLIService tcliService = new ThriftBinaryCLIService(cliService);
    tcliService.init(hconf);
    TProcessorFactory procFactory = PlainSaslHelper.getPlainProcessorFactory(tcliService);
    assertEquals("doAs enabled processor for unsecure mode",
        procFactory.getProcessor(null).getClass(), TSetIpAddressProcessor.class);
  }
Test setting {@link HiveConf.ConfVars}} config parameter
  HIVE_SERVER2_ENABLE_DOAS for unsecure mode
service/src/test/org/apache/hive/service/auth/TestPlainSaslHelper.java