@Test
  public void testGetClusters() throws Exception, AuthorizationException {
    String cluster1 = getUniqueName();

    clusters.addCluster(cluster1, new StackId("HDP-0.1"));

    Cluster c1 = clusters.getCluster(cluster1);

    StackId stackId = new StackId("HDP-0.1");
    c1.setDesiredStackVersion(stackId);
    helper.getOrCreateRepositoryVersion(stackId, stackId.getStackVersion());

    ClusterRequest r = new ClusterRequest(null, null, null, null);
    Set<ClusterResponse> resp = controller.getClusters(Collections.singleton(r));

    // !!! many tests are creating clusters, just make sure we have at least one
    Assert.assertFalse(resp.isEmpty());

    boolean found = false;
    for (ClusterResponse cr : resp) {
      if (cr.getClusterName().equals(cluster1)) {
        Assert.assertEquals(c1.getClusterId(), cr.getClusterId());
        Assert.assertEquals(c1.getDesiredStackVersion().getStackId(), cr.getDesiredStackVersion());
        found = true;
        break;
      }
    }

    Assert.assertTrue(found);
  }
Create a cluster with a service, and verify that the request tasks have the correct output log and error log paths.
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java