@Test
  public void setMonitoringServicesRestartRequired() throws Exception {
    String cluster1 = getUniqueName();
    createCluster(cluster1);
    Cluster cluster = clusters.getCluster(cluster1);
    StackId stackId = new StackId("HDP-2.0.8");
    cluster.setDesiredStackVersion(stackId);
    cluster.setCurrentStackVersion(stackId);

    String hdfsService = "HDFS";
    String fakeMonitoringService = "FAKENAGIOS";
    createService(cluster1, hdfsService, repositoryVersion208, null);
    createService(cluster1, fakeMonitoringService, repositoryVersion208, null);

    String namenode = "NAMENODE";
    String datanode = "DATANODE";
    String hdfsClient = "HDFS_CLIENT";
    String fakeServer = "FAKE_MONITORING_SERVER";

    createServiceComponent(cluster1, hdfsService, namenode, State.INIT);
    createServiceComponent(cluster1, hdfsService, datanode, State.INIT);
    createServiceComponent(cluster1, fakeMonitoringService, fakeServer, State.INIT);

    String host1 = getUniqueName();

    addHostToCluster(host1, cluster1);
    createServiceComponentHost(cluster1, hdfsService, namenode, host1, null);
    createServiceComponentHost(cluster1, hdfsService, datanode, host1, null);
    createServiceComponentHost(cluster1, fakeMonitoringService, fakeServer, host1,
      null);


    ServiceComponentHost monitoringServiceComponentHost = null;
    for (ServiceComponentHost sch : cluster.getServiceComponentHosts(host1)) {
      if (sch.getServiceComponentName().equals(fakeServer)) {
        monitoringServiceComponentHost = sch;
      }
    }

    assertFalse(monitoringServiceComponentHost.isRestartRequired());

    createServiceComponent(cluster1, hdfsService, hdfsClient,
      State.INIT);

    createServiceComponentHost(cluster1, hdfsService, hdfsClient, host1, null);

    assertTrue(monitoringServiceComponentHost.isRestartRequired());
  }
Ensure that ServiceNotFoundException is handled where there are multiple requests as would be the
case when an OR predicate is provided in the query.
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java