@Test
  public void testCreateHostMultiple() throws Exception {
    String host1 = getUniqueName();
    String host2 = getUniqueName();
    String host3 = getUniqueName();
    String cluster1 = getUniqueName();

    clusters.addHost(host1);
    clusters.addHost(host2);
    clusters.addHost(host3);
    clusters.addCluster(cluster1, new StackId("HDP-0.1"));
    Cluster c = clusters.getCluster(cluster1);
    StackId stackID = new StackId("HDP-0.1");
    c.setDesiredStackVersion(stackID);
    c.setCurrentStackVersion(stackID);
    helper.getOrCreateRepositoryVersion(stackID, stackID.getStackVersion());

    setOsFamily(clusters.getHost(host1), "redhat", "5.9");
    setOsFamily(clusters.getHost(host2), "redhat", "5.9");
    setOsFamily(clusters.getHost(host3), "redhat", "5.9");

    HostRequest r1 = new HostRequest(host1, cluster1);
    HostRequest r2 = new HostRequest(host2, cluster1);
    HostRequest r3 = new HostRequest(host3, null);

    Set<HostRequest> set1 = new HashSet<>();
    set1.add(r1);
    set1.add(r2);
    set1.add(r3);
    HostResourceProviderTest.createHosts(controller, set1);

    Assert.assertEquals(1, clusters.getClustersForHost(host1).size());
    Assert.assertEquals(1, clusters.getClustersForHost(host2).size());
    Assert.assertEquals(0, clusters.getClustersForHost(host3).size());
  }
Allows to set maintenanceStateHelper. For use when there is anything to test
with maintenance mode.
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java