@Test
  public void testKerberosJson() throws Exception {
    ServiceInfo svc;

    svc = metaInfo.getService(STACK_NAME_HDP, "2.0.8", "HDFS");
    Assert.assertNotNull(svc);

    File kerberosDescriptorFile1 = svc.getKerberosDescriptorFile();
    Assert.assertNotNull(kerberosDescriptorFile1);
    Assert.assertTrue(kerberosDescriptorFile1.exists());

    svc = metaInfo.getService(STACK_NAME_HDP, "2.1.1", "HDFS");
    Assert.assertNotNull(svc);

    File kerberosDescriptorFile2 = svc.getKerberosDescriptorFile();
    Assert.assertNotNull(kerberosDescriptorFile1);
    Assert.assertTrue(kerberosDescriptorFile1.exists());

    Assert.assertEquals(kerberosDescriptorFile1, kerberosDescriptorFile2);

    svc = metaInfo.getService(STACK_NAME_HDP, "2.0.7", "HDFS");
    Assert.assertNotNull(svc);

    File kerberosDescriptorFile3 = svc.getKerberosDescriptorFile();
    Assert.assertNull(kerberosDescriptorFile3);
  }
Make sure global mapping is avaliable when global.xml is
in the path.
ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java