private void setupKerberosDescriptor(KerberosDescriptor kerberosDescriptor) throws Exception {
    // cluster.getCurrentStackVersion expectation is already specified in main test method
    AmbariMetaInfo metaInfo = injector.getInstance(AmbariMetaInfo.class);
    expect(metaInfo.
        getKerberosDescriptor("HDP", "2.2", false)).andReturn(kerberosDescriptor).anyTimes();
    expect(kerberosDescriptor.principals()).andReturn(Collections.<String, String>emptyMap()).anyTimes();
  }
Test that a Kerberos Descriptor that contains a Service with 0 Components does not raise any exceptions.
ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java