private ServiceComponent createMockComponent(String componentName, boolean isMasterComponent, Map<String, ServiceComponentHost> hosts) {
    ServiceComponent component = createMock(ServiceComponent.class);
    expect(component.getName()).andReturn(componentName).anyTimes();
    expect(component.isMasterComponent()).andReturn(isMasterComponent).anyTimes();
    expect(component.isClientComponent()).andReturn(!isMasterComponent).anyTimes();
    expect(component.getServiceComponentHosts()).andReturn(hosts).anyTimes();
    return component;
  }
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