private KerberosComponentDescriptor createMockComponentDescriptor(String componentName,
                                                                    List<KerberosIdentityDescriptor> identities,
                                                                    Map<String, KerberosConfigurationDescriptor> configurations)
      throws AmbariException {
    KerberosComponentDescriptor descriptor = createMock(KerberosComponentDescriptor.class);
    expect(descriptor.getName()).andReturn(componentName).anyTimes();
    expect(descriptor.getIdentities(eq(true), EasyMock.anyObject())).andReturn(identities).anyTimes();
    expect(descriptor.getConfigurations(true)).andReturn(configurations).anyTimes();
    expect(descriptor.getAuthToLocalProperties()).andReturn(null).anyTimes();
    return descriptor;
  }
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