@Test
public void testGetRootServices() throws Exception {

  // Request a null service name
  RootServiceRequest request = new RootServiceRequest(null);
  Set<RootServiceResponse> rootServices = responseFactory.getRootServices(request);
  assertEquals(RootServiceResponseFactory.Services.values().length,
      rootServices.size());
  // null request
  request = null;
  rootServices = responseFactory.getRootServices(request);
  assertEquals(RootServiceResponseFactory.Services.values().length,
      rootServices.size());
  // Request nonexistent service
  try {
    request = new RootServiceRequest("XXX");
    rootServices = responseFactory.getRootServices(request);
  } catch (Exception e) {
    assertTrue(e instanceof ObjectNotFoundException);
  }
  // Request existent service
  request = new RootServiceRequest(
      RootServiceResponseFactory.Services.AMBARI.name());
  rootServices = responseFactory.getRootServices(request);
  assertEquals(1, rootServices.size());
  assertTrue(rootServices.contains(new RootServiceResponse(
      RootServiceResponseFactory.Services.AMBARI.name())));
}