private Host createMockHost(String hostname) {
    Host host = createMock(Host.class);
    expect(host.getHostName()).andReturn(hostname).anyTimes();
    expect(host.getState()).andReturn(HostState.HEALTHY).anyTimes();
    expect(host.getCurrentPingPort()).andReturn(1).anyTimes();
    expect(host.getRackInfo()).andReturn("rack1").anyTimes();
    expect(host.getIPv4()).andReturn("1.2.3.4").anyTimes();
    return host;
  }
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