use of org.eclipse.che.ide.api.machine.events.MachineStateEvent in project che by eclipse.
the class MachinePanelPresenterTest method machineShouldBeRemovedFromTreeWhenItIsDestroyed.
@Test
public void machineShouldBeRemovedFromTreeWhenItIsDestroyed() {
when(machine1.getId()).thenReturn("machine1");
MachineStateEvent stateEvent = mock(MachineStateEvent.class);
when(stateEvent.getMachineId()).thenReturn("machine1");
when(stateEvent.getMachine()).thenReturn(machine1);
presenter.onMachineCreating(stateEvent);
reset(view);
presenter.onMachineRunning(stateEvent);
verify(view).selectNode(machineNode1);
reset(view);
presenter.onMachineDestroyed(stateEvent);
verify(view).setData(rootNode);
verify(view, never()).selectNode(machineNode1);
}
use of org.eclipse.che.ide.api.machine.events.MachineStateEvent in project che by eclipse.
the class MachinePanelPresenterTest method machineShouldBeAddedToTreeWhenItIsJustCreated.
@Test
public void machineShouldBeAddedToTreeWhenItIsJustCreated() {
when(machine1.getId()).thenReturn("machine1");
MachineStateEvent stateEvent = mock(MachineStateEvent.class);
when(stateEvent.getMachine()).thenReturn(machine1);
presenter.onMachineCreating(stateEvent);
verify(view).setData(rootNode);
verify(view).selectNode(machineNode1);
assertThat(presenter.isMachineRunning(), is(false));
}
Aggregations