@Test
  public void testDeleteAllServiceConfigGroups() throws AmbariException {
    String serviceName = "HDFS";
    Service s = serviceFactory.createNew(cluster, serviceName, repositoryVersion);
    cluster.addService(s);

    Service service = cluster.getService(serviceName);

    ConfigGroup configGroup1 = createNiceMock(ConfigGroup.class);
    ConfigGroup configGroup2 = createNiceMock(ConfigGroup.class);

    expect(configGroup1.getId()).andReturn(1L).anyTimes();
    expect(configGroup2.getId()).andReturn(2L).anyTimes();

    expect(configGroup1.getServiceName()).andReturn(serviceName).anyTimes();
    expect(configGroup2.getServiceName()).andReturn(serviceName).anyTimes();

    expect(configGroup1.getClusterName()).andReturn(cluster.getClusterName()).anyTimes();
    expect(configGroup2.getClusterName()).andReturn(cluster.getClusterName()).anyTimes();

    replay(configGroup1, configGroup2);

    cluster.addConfigGroup(configGroup1);
    cluster.addConfigGroup(configGroup2);

    ((ServiceImpl)service).deleteAllServiceConfigGroups();

    assertTrue(MapUtils.isEmpty(cluster.getConfigGroupsByServiceName(serviceName)));

    verify(configGroup1, configGroup2);
  }
Tests the kerberosEnabledTest value set in the HDFS metainfo file (stacks/HDP/0.1/services/HDFS/metainfo.xml):
<pre>
{
  "or": [
    {
      "equals": [
        "core-site/hadoop.security.authentication",
        "kerberos"
      ]
    },
    {
      "equals": [
        "hdfs-site/hadoop.security.authentication",
        "kerberos"
      ]
    }
  ]
}
</pre>
ambari-server/src/test/java/org/apache/ambari/server/state/ServiceTest.java