ToolbarViewPresenterImpl implements ToolbarView.Presenter, SimpleDownloadSelectedHandler { @Override public void onSimpleDownloadSelected(SimpleDownloadSelected event) { eventBus.fireEvent(new RequestSimpleDownloadEvent(event.getSelectedDiskResources(), event.getSelectedFolder())); } @Inject  ToolbarViewPresenterImpl(final ToolbarViewFactory viewFactory,
                             GenomeSearchDialog genomeSearchView,
                             BulkMetadataDialogFactory bulkMetadataViewFactory,
                             GenomeAutoBeanFactory gFactory,
                             @Assisted DiskResourceView.Presenter parentPresenter); @Override ToolbarView getView(); @Override void onCreateNewDelimitedFileSelected(); @Override void onCreateNewFileSelected(final Folder selectedFolder, final MimeType mimeType); @Override void onCreateNewFolderSelected(final Folder selectedFolder); @Override void onCreateNcbiSraFolderStructure(final Folder selectedFolder); @Override void onCreateNewPathListSelected(); @Override void onCreatePublicLinkSelected(final List<DiskResource> selectedDiskResources); @Override void onEditFileSelected(final List<DiskResource> selectedDiskResources); @Override void onOpenNewWindowAtLocationSelected(final Folder selectedFolder); @Override void onOpenNewWindowSelected(); @Override void onOpenTrashFolderSelected(); @Override void onSimpleDownloadSelected(SimpleDownloadSelected event); @Override void onImportFromCoge(); @Override void searchGenomeInCoge(String searchTerm); @Override void importGenomeFromCoge(Integer id); @Override void onBulkMetadataSelected(final BulkMetadataDialog.BULK_MODE mode); @Override void submitBulkMetadataFromExistingFile(String filePath,
                                                   String destFolder); @Override void onDoiRequest(String uuid);  }
@Test public void onSimpleDownloadSelected_firesEvent() { SimpleDownloadSelected eventMock = mock(SimpleDownloadSelected.class); List<DiskResource> selectedResourcesMock = Collections.emptyList(); Folder selectedFolderMock = mock(Folder.class); when(eventMock.getSelectedDiskResources()).thenReturn(selectedResourcesMock); when(eventMock.getSelectedFolder()).thenReturn(selectedFolderMock); uut.onSimpleDownloadSelected(eventMock); ArgumentCaptor<RequestSimpleDownloadEvent> captor = ArgumentCaptor.forClass(RequestSimpleDownloadEvent.class); verify(eventBusMock).fireEvent(captor.capture()); assertEquals(selectedResourcesMock, captor.getValue().getRequestedResources()); assertEquals(selectedFolderMock, captor.getValue().getCurrentFolder()); verifyNoMoreInteractions(eventBusMock); }