@Test(expected=AmbariException.class)
  public void testCreateServiceComponentHostExclusiveAmbariException()
      throws Exception {
    String cluster1 = getUniqueName();
    createCluster(cluster1);
    String serviceName = "HDFS";
    createService(cluster1, serviceName, null);
    String componentName1 = "NAMENODE";
    String componentName2 = "DATANODE";
    String componentName3 = "EXCLUSIVE_DEPENDENCY_COMPONENT";
    createServiceComponent(cluster1, serviceName, componentName1,
        State.INIT);
    createServiceComponent(cluster1, serviceName, componentName2,
        State.INIT);
    createServiceComponent(cluster1, serviceName, componentName3,
        State.INIT);
    String host1 = getUniqueName();
    String host2 = getUniqueName();
    addHostToCluster(host1, cluster1);
    addHostToCluster(host2, cluster1);

    Set<ServiceComponentHostRequest> set1 =
      new HashSet<>();
    ServiceComponentHostRequest r1 =
        new ServiceComponentHostRequest(cluster1, serviceName,
            componentName1, host1, State.INIT.toString());
    ServiceComponentHostRequest r2 =
        new ServiceComponentHostRequest(cluster1, serviceName,
            componentName3, host1, State.INIT.toString());
    ServiceComponentHostRequest r3 =
        new ServiceComponentHostRequest(cluster1, serviceName,
            componentName2, host1, State.INIT.toString());

    set1.add(r1);
    set1.add(r2);
    set1.add(r3);

    controller.createHostComponents(set1);
  }
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