@Test public void editorNodeShouldBeUpdated() { editorAgent.openEditor(file, callback); editorAgent.updateEditorNode(PATH, newFileNode); verify(editor, times(2)).getEditorInput(); verify(editorInput).setFile(newFileNode); verify(editor).onFileChanged(); assertThat(editorAgent.getOpenedEditors().contains(editor), is(true)); }
@Test public void editorNodeShouldNotBeUpdatedBecauseFileIsNotOpened() { editorAgent.updateEditorNode(PATH, newFileNode); verifyNoMoreInteractions(editor, newFileNode, editorInput); }