@Test
public void testGetClusters___ClusterNotFoundException() throws Exception {

  // member state mocks
  Injector injector = createStrictMock(Injector.class);
  Capture<AmbariManagementController> controllerCapture = EasyMock.newCapture();
  // requests
  ClusterRequest request1 = new ClusterRequest(null, "cluster1", "1", Collections.<String>emptySet());
  Set<ClusterRequest> setRequests = new HashSet<ClusterRequest>();
  setRequests.add(request1);
  // expectations
  // constructor init
  injector.injectMembers(capture(controllerCapture));
  expect(injector.getInstance(Gson.class)).andReturn(null);
  expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
  expect(injector.getInstance(KerberosHelper.class)).andReturn(createNiceMock(KerberosHelper.class));
  // getCluster
  expect(clusters.getCluster("cluster1")).andThrow(new ClusterNotFoundException("cluster1"));
  // replay mocks
  replay(injector, clusters);
  //test
  AmbariManagementController controller = new AmbariManagementControllerImpl(null, clusters, injector);
  // assert that exception is thrown in case where there is a single request
  try {
    controller.getClusters(setRequests);
    fail("expected ClusterNotFoundException");
  } catch (ClusterNotFoundException e) {
    // expected
  }
  verify(injector, clusters);
}