private Service createMockService(String serviceName, Map<String, ServiceComponent> componentMap) {
    Service service = createMock(Service.class);
    expect(service.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
    expect(service.getName()).andReturn(serviceName).anyTimes();
    expect(service.getServiceComponents()).andReturn(componentMap).anyTimes();
    return service;
  }
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