@Test
  public void testSessionNullUser() throws Exception {
    SessionState ss = new SessionState(getAuthV2HiveConf(), null);
    setupDataNucleusFreeHive(ss.getConf());
    SessionState.start(ss);

    assertNull("getGroupNames when userName == null", ss.getAuthenticator().getGroupNames());
  }
Test that the groupNames returned is null, when the user name is null. The user name is null
in the case of embedded HS2 and we assert that we don't throw an NPE in that case.
@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/parse/authorization/TestSessionUserName.java