@Test public void testCopyNotification() { copyPopUpPresenterShowMock(); when(copyPopUpPresenterMock.getView()).thenReturn(copyPopUpView); final FolderItem item = mock(FolderItem.class); presenter.copyItem(item); verify(notification, times(1)).fire(any(NotificationEvent.class)); }
public void copyItem(final FolderItem folderItem) { final Path path = getFolderItemPath(folderItem); validationService.call(messages -> { if (((List<ValidationMessage>) messages).isEmpty()) { showCopyPopup(folderItem, path); } else { validationPopup.showCopyValidationMessages(() -> showCopyPopup(folderItem, path), () -> { }, (List<ValidationMessage>) messages); } }).validateForCopy(path); }
BaseViewPresenter { public void copyItem(final FolderItem folderItem) { final Path path = getFolderItemPath(folderItem); validationService.call(messages -> { if (((List<ValidationMessage>) messages).isEmpty()) { showCopyPopup(folderItem, path); } else { validationPopup.showCopyValidationMessages(() -> showCopyPopup(folderItem, path), () -> { }, (List<ValidationMessage>) messages); } }).validateForCopy(path); } }
BaseViewPresenter { public void copyItem(final FolderItem folderItem) { final Path path = getFolderItemPath(folderItem); validationService.call(messages -> { if (((List<ValidationMessage>) messages).isEmpty()) { showCopyPopup(folderItem, path); } else { validationPopup.showCopyValidationMessages(() -> showCopyPopup(folderItem, path), () -> { }, (List<ValidationMessage>) messages); } }).validateForCopy(path); } BaseViewPresenter(BaseViewImpl baseView); }
BaseViewPresenter { public void copyItem(final FolderItem folderItem) { final Path path = getFolderItemPath(folderItem); validationService.call(messages -> { if (((List<ValidationMessage>) messages).isEmpty()) { showCopyPopup(folderItem, path); } else { validationPopup.showCopyValidationMessages(() -> showCopyPopup(folderItem, path), () -> { }, (List<ValidationMessage>) messages); } }).validateForCopy(path); } BaseViewPresenter(BaseViewImpl baseView); @PostConstruct void init(); void onActiveOptionsChange(final @Observes ActiveOptionsChangedEvent changedEvent); void update(); void refresh(); void loadContent(final FolderItem item); FolderListing getActiveContent(); void deleteItem(final FolderItem folderItem); void renameItem(final FolderItem folderItem); void copyItem(final FolderItem folderItem); void uploadArchivedFolder(final FolderItem folderItem); String getCurrentTag(); Set<String> getActiveContentTags(); void onModuleSelected(final Module module); void onActiveFolderItemSelected(final FolderItem item); void onItemSelected(final FolderItem folderItem); void setVisible(final boolean visible); void onTagFilterChanged(@Observes TagChangedEvent event); void onResourceUpdated(@Observes final ResourceUpdatedEvent event); void onResourceAdded(@Observes final ResourceAddedEvent event); void onResourceDeleted(@Observes final ResourceDeletedEvent event); void onResourceCopied(@Observes final ResourceCopiedEvent event); void onLockStatusChange(@Observes final LockInfo lockInfo); void initialiseViewForActiveContext(final WorkspaceProjectContext context); void initialiseViewForActiveContext(String initPath); void onResourceRenamed(@Observes final ResourceRenamedEvent event); boolean canShowTags(); }
BaseViewPresenter { public void copyItem(final FolderItem folderItem) { final Path path = getFolderItemPath(folderItem); validationService.call(messages -> { if (((List<ValidationMessage>) messages).isEmpty()) { showCopyPopup(folderItem, path); } else { validationPopup.showCopyValidationMessages(() -> showCopyPopup(folderItem, path), () -> { }, (List<ValidationMessage>) messages); } }).validateForCopy(path); } BaseViewPresenter(BaseViewImpl baseView); @PostConstruct void init(); void onActiveOptionsChange(final @Observes ActiveOptionsChangedEvent changedEvent); void update(); void refresh(); void loadContent(final FolderItem item); FolderListing getActiveContent(); void deleteItem(final FolderItem folderItem); void renameItem(final FolderItem folderItem); void copyItem(final FolderItem folderItem); void uploadArchivedFolder(final FolderItem folderItem); String getCurrentTag(); Set<String> getActiveContentTags(); void onModuleSelected(final Module module); void onActiveFolderItemSelected(final FolderItem item); void onItemSelected(final FolderItem folderItem); void setVisible(final boolean visible); void onTagFilterChanged(@Observes TagChangedEvent event); void onResourceUpdated(@Observes final ResourceUpdatedEvent event); void onResourceAdded(@Observes final ResourceAddedEvent event); void onResourceDeleted(@Observes final ResourceDeletedEvent event); void onResourceCopied(@Observes final ResourceCopiedEvent event); void onLockStatusChange(@Observes final LockInfo lockInfo); void initialiseViewForActiveContext(final WorkspaceProjectContext context); void initialiseViewForActiveContext(String initPath); void onResourceRenamed(@Observes final ResourceRenamedEvent event); boolean canShowTags();  }