@Test
public void testInitializeAtHDFSCluster() throws AmbariException {

  ClusterImpl cluster = createMock(ClusterImpl.class);
  expect(cluster.getService("GLUSTERFS")).andReturn(null);
  expect(cluster.getClusterId()).andReturn(1L);
  Service hdfsService = createMock(Service.class);
  expect(cluster.getService("HDFS")).andReturn(hdfsService).atLeastOnce();
  expect(cluster.getService("YARN")).andReturn(null).atLeastOnce();
  expect(hdfsService.getServiceComponent("JOURNALNODE")).andReturn(null);
  expect(cluster.getCurrentStackVersion()).andReturn(new StackId("HDP", "2.0.6"));
  replay(cluster);
  replay(hdfsService);
  RoleCommandOrder rco = roleCommandOrderProvider.getRoleCommandOrder(cluster);
  Map<RoleCommandPair, Set<RoleCommandPair>> deps = rco.getDependencies();
  assertTrue("Dependencies are loaded after initialization", deps.size() > 0);
  verify(cluster);
  verify(hdfsService);
  // Check that GLUSTERFS components are not present in dependencies
  // Checking blocked roles
  assertFalse(dependenciesContainBlockedRole(deps, Role.PEERSTATUS));
  assertFalse(dependenciesContainBlockedRole(deps, Role.GLUSTERFS_SERVICE_CHECK));
  assertFalse(dependenciesContainBlockedRole(deps, Role.GLUSTERFS_CLIENT));
  // Checking blocker roles
  assertFalse(dependenciesContainBlockerRole(deps, Role.PEERSTATUS));
  assertFalse(dependenciesContainBlockerRole(deps, Role.GLUSTERFS_SERVICE_CHECK));
  assertFalse(dependenciesContainBlockerRole(deps, Role.GLUSTERFS_CLIENT));
  // And that some HDFS components are present (section has been loaded)
  assertTrue(dependenciesContainBlockerRole(deps, Role.DATANODE));
  // Check that there is no HA NN dependencies present
  assertFalse(dependenciesContainBlockerRole(deps, Role.JOURNALNODE));
  assertFalse(dependenciesContainBlockedRole(deps, Role.ZKFC));
}