RequestListPresenter extends AbstractMultiGridPresenter<RequestSummary, RequestListPresenter.RequestListView> { @Override public void selectSummaryItem(final RequestSummary job) { if (job.getStatus() != null) { setupDetailBreadcrumb(constants.JobBreadcrumb(job.getId())); placeManager.goTo(PerspectiveIds.JOB_DETAILS_SCREEN); jobSelectedEvent.fire(new JobSelectedEvent(getSelectedServerTemplate(), job.getDeploymentId(), job.getJobId())); } } RequestListPresenter();  RequestListPresenter(RequestListViewImpl view,
                                Caller<ExecutorService> executorServices,
                                DataSetQueryHelper dataSetQueryHelper,
                                Event<RequestChangedEvent> requestChangedEvent,
                                Event<JobSelectedEvent> jobSelectedEvent,
                                PlaceManager placeManager); @Inject void setFilterSettingsManager(final JobListFilterSettingsManager filterSettingsManager); @Override void createListBreadcrumb(); void setupDetailBreadcrumb(String detailLabel); void cancelRequest(final String deploymentId,
                              final Long requestId); void requeueRequest(final String deploymentId,
                               final Long requestId); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @Override void selectSummaryItem(final RequestSummary job); void requestCreated(@Observes RequestChangedEvent event); @Override void setupActiveSearchFilters(); @Override boolean existActiveSearchFilters(); @Override ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter); String getStatusColumnFilterDescription(ColumnFilter columnFilter); void openProcessInstanceView(final String processInstanceId); Predicate<RequestSummary> getCancelActionCondition(); Predicate<RequestSummary> getRequeueActionCondition(); Predicate<RequestSummary> getViewProcessActionCondition(); void bulkCancel(List<RequestSummary> jobsSelected); void bulkRequeue(List<RequestSummary> jobsSelected);  }
@Test public void testJobSelectionWithDetailsClosed() { RequestSummary job = createRequestSummary(); presenter.selectSummaryItem(job); verify(placeManager).goTo(PerspectiveIds.JOB_DETAILS_SCREEN); final ArgumentCaptor<JobSelectedEvent> captor = ArgumentCaptor.forClass(JobSelectedEvent.class); verify(jobSelectedEventMock).fire(captor.capture()); assertJobSelectedEventContent(captor.getValue(), job.getDeploymentId(), job.getId()); verify(breadcrumbs).addBreadCrumb(eq(PERSPECTIVE_ID), eq(Constants.INSTANCE.JobBreadcrumb(job.getId())), eq(Commands.DO_NOTHING)); }
@Test public void testJobSelectionWithDetailsOpen() { RequestSummary job = createRequestSummary(); presenter.selectSummaryItem(job); verify(placeManager, never()).goTo(any(PlaceRequest.class)); final ArgumentCaptor<JobSelectedEvent> captor = ArgumentCaptor.forClass(JobSelectedEvent.class); verify(jobSelectedEventMock).fire(captor.capture()); assertJobSelectedEventContent(captor.getValue(), job.getDeploymentId(), job.getId()); }