@Test
  public void testInitializeDefault() throws IOException {

    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);
    expect(hdfsService.getServiceComponent("JOURNALNODE")).andReturn(null);
    //There is no rco file in this stack, should use default
//    expect(cluster.getCurrentStackVersion()).andReturn(new StackId("HDP", "2.0.5"));
    expect(hdfsService.getDesiredStackId()).andReturn(new StackId("HDP", "2.0.5"));
    expect(cluster.getServices()).andReturn(ImmutableMap.<String, Service>builder()
        .put("HDFS", hdfsService)
        .build()).anyTimes();

    replay(cluster);
    replay(hdfsService);

    RoleCommandOrder rco = roleCommandOrderProvider.getRoleCommandOrder(cluster);

    verify(cluster);
    verify(hdfsService);
  }
Tests building dependencies in HA-enabled HDFS cluster. Uses real
dependency mapping file (role_command_order.json)
ambari-server/src/test/java/org/apache/ambari/server/metadata/RoleCommandOrderTest.java