@Test public void testOnTransMemoryCopy() { when(tableEditorMessages.notifyCopied()).thenReturn("copied"); selectedTU = currentPageRows.get(0); when(display.getId()).thenReturn(selectedTU.getId()); when(display.getEditors()).thenReturn(Lists.newArrayList(editor)); presenter.setStatesForTesting(selectedTU.getId(), 0, display); presenter.onDataCopy(new CopyDataToEditorEvent(Arrays.asList("target"))); verify(editor).setTextAndValidate("target"); verify(eventBus, atLeastOnce()).fireEvent(eventCaptor.capture()); NotificationEvent notificationEvent = TestFixture.extractFromEvents(eventCaptor.getAllValues(), NotificationEvent.class); MatcherAssert.assertThat(notificationEvent.getMessage(), Matchers.equalTo("copied")); }