RequestListPresenter extends AbstractMultiGridPresenter<RequestSummary, RequestListPresenter.RequestListView> { public void cancelRequest(final String deploymentId, final Long requestId) { executorServices.call( (Void nothing) -> { view.displayNotification(constants.RequestCanceled(requestId)); requestChangedEvent.fire(new RequestChangedEvent(requestId)); }).cancelRequest(getSelectedServerTemplate(), deploymentId, requestId); } 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 cancelRequestTest() { presenter.cancelRequest(null, REQUEST_ID); verify(requestChangedEvent, times(1)).fire(any(RequestChangedEvent.class)); verify(executorServiceMock).cancelRequest(anyString(), eq(null), eq(REQUEST_ID)); }
@Test public void cancelRequestTestWithDeploymentId() { presenter.cancelRequest("test", REQUEST_ID); verify(requestChangedEvent, times(1)).fire(any(RequestChangedEvent.class)); verify(executorServiceMock).cancelRequest(anyString(), eq("test"), eq(REQUEST_ID)); }