@Test
public void testGetHostNameOrIpFromTokenConf()
        throws SocketException, YarnException {

  Configuration conf = mock(Configuration.class);
  when(conf.getBoolean(
          CommonConfigurationKeys.HADOOP_SECURITY_TOKEN_SERVICE_USE_IP,
          CommonConfigurationKeys
                  .HADOOP_SECURITY_TOKEN_SERVICE_USE_IP_DEFAULT))
          .thenReturn(false);
  assertNull(Utils.getHostNameOrIpFromTokenConf(conf));
}