@Test public void canCopySourceForActiveRow() { // Given: current editor is focused TargetContentsPresenter spyPresenter = spy(presenter); selectedTU = currentPageRows.get(0); spyPresenter.setStatesForTesting(selectedTU.getId(), 0, display); doNothing().when(spyPresenter).copySource(editor, selectedTU.getId()); when(editor.isFocused()).thenReturn(true); when(display.getEditors()).thenReturn(Lists.newArrayList(editor)); // When: spyPresenter.copySourceForActiveRow(); // Then: verify(spyPresenter).copySource(editor, selectedTU.getId()); }