@Test
  public void stubShouldBeDisplayedWhenMachinesNotExist() throws OperationException {
    presenter.showMachines();

    verify(machineStatePromise).then(operationMachineStateCaptor.capture());
    operationMachineStateCaptor.getValue().apply(Collections.<MachineStateDto>emptyList());

    verify(locale).unavailableMachineInfo();
    verify(appliance).showStub(anyString());

    verify(view, never()).setData(rootNode);
  }
  @Test
  public void treeShouldBeDisplayedWithMachines() throws Exception {
    presenter.showMachines();

    verify(service).getMachinesStates(anyString());

    verify(machineStatePromise).then(operationMachineStateCaptor.capture());
    operationMachineStateCaptor.getValue().apply(Collections.singletonList(machineState1));

    verify(entityFactory)
        .createMachineNode(
            isNull(MachineTreeNode.class), eq("root"), Matchers.<List<MachineTreeNode>>anyObject());
    verify(entityFactory).createMachineNode(eq(rootNode), eq(machineState1), eq(null));

    verify(view).setData(Matchers.<MachineTreeNode>anyObject());
    verify(view).selectNode(machineNode1);
  }