RequestListPresenter extends AbstractMultiGridPresenter<RequestSummary, RequestListPresenter.RequestListView> { @Override public ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter) { if (columnFilter instanceof CoreFunctionFilter) { CoreFunctionFilter coreFunctionFilter = (CoreFunctionFilter) columnFilter; if (columnFilter.getColumnId().equals(COLUMN_STATUS) && (coreFunctionFilter.getType() == CoreFunctionType.IN || coreFunctionFilter.getType() == CoreFunctionType.EQUALS_TO)) { return new ActiveFilterItem<>(constants.Status(), getStatusColumnFilterDescription(columnFilter), null, coreFunctionFilter.getParameters(), v -> removeActiveFilter(columnFilter)); } } return super.getActiveFilterFromColumnFilter(columnFilter); } 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 testActiveFilterLabelStatus() { ColumnFilter testColumFilter = equalsTo(COLUMN_STATUS, Arrays.asList(RequestStatus.CANCELLED.name(), RequestStatus.RUNNING.name())); ActiveFilterItem activeFilterItem = presenter.getActiveFilterFromColumnFilter(testColumFilter); assertEquals(Constants.INSTANCE.Status(), activeFilterItem.getKey()); assertEquals("Status: Canceled, Running", activeFilterItem.getLabelValue()); assertNotEquals(testColumFilter.toString(), activeFilterItem.getLabelValue()); }
@Test public void testActiveFilterLabelOther() { ColumnFilter testColumFilter = equalsTo(COLUMN_PROCESS_INSTANCE_ID, 1); ActiveFilterItem activeFilterItem = presenter.getActiveFilterFromColumnFilter(testColumFilter); assertEquals(COLUMN_PROCESS_INSTANCE_ID, activeFilterItem.getKey()); assertEquals(testColumFilter.toString(), activeFilterItem.getLabelValue()); testColumFilter = equalsTo(COLUMN_BUSINESSKEY, "key"); activeFilterItem = presenter.getActiveFilterFromColumnFilter(testColumFilter); assertEquals(COLUMN_BUSINESSKEY, activeFilterItem.getKey()); assertEquals(testColumFilter.toString(), activeFilterItem.getLabelValue()); }