@Test
  public void testProxyUser() throws Exception {
    String connectingUser = "user1";
    String proxyUser = System.getProperty("user.name");
    Map<String, String>sessConf = new HashMap<String,String>();
    sessConf.put(HiveAuthConstants.HS2_PROXY_USER, proxyUser);
    sessionUserName = proxyUser;
    SessionHandle sessionHandle = client.openSession(connectingUser, "foobar", sessConf);
    Assert.assertEquals(1, SessionHookTest.runCount.get());
    client.closeSession(sessionHandle);
  }
Create session with proxy user property. Verify the effective session user
@throws Exception
service/src/test/org/apache/hive/service/cli/session/TestSessionHooks.java