AbstractTaskListPresenter extends AbstractMultiGridPresenter<TaskSummary, V> { @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); }  abstract void setupDetailBreadcrumb(String detailLabel); @Override void openErrorView(final String tId); @Override Predicate<TaskSummary> getViewErrorsActionCondition(); void getDomainSpecifDataForTasks(final Integer startRange,
                                            final List<TaskSummary> tasksFromDataSet,
                                            final Boolean lastPageExactCount); void releaseTask(final TaskSummary task); void claimTask(final TaskSummary task); void claimAndWorkTask(final TaskSummary task); void resumeTask(final TaskSummary task); void suspendTask(final TaskSummary task); void getMenus(final Consumer<Menus> menusConsumer); @Override void selectSummaryItem(final TaskSummary summary); void onTaskRefreshedEvent(@Observes TaskRefreshedEvent event); void onTaskDetailsClosed(@Observes BeforeClosePlaceEvent closed); void onTaskCompletedEvent(@Observes TaskCompletedEvent event); @Inject void setDataSetQueryHelperDomainSpecific(final DataSetQueryHelper dataSetQueryHelperDomainSpecific); @Inject void setTaskService(final Caller<TaskService> taskService); @Override void setupActiveSearchFilters(); @Override boolean existActiveSearchFilters(); @Override ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter); String getStatusColumnFilterDescription(ColumnFilter columnFilter); void openProcessInstanceView(final String processInstanceId); void bulkClaim(List<TaskSummary> taskSummaries); void bulkRelease(List<TaskSummary> taskSummaries); void bulkResume(List<TaskSummary> taskSummaries); void bulkSuspend(List<TaskSummary> taskSummaries); void bulkReassign(List<TaskSummary> taskSummaries); @Inject void setTranslationService(TranslationService translationService);  }
@Test public void testActiveFilterLabelStatus() { String readyTranslation = "Ready_t"; String reservedTranslation = "Reserved_t"; String inProgressTranslation = "InProgress_t"; final List<Comparable> status = new ArrayList<>(getStatusByType(TaskType.ACTIVE)); when(translationServiceMock.format("Ready")).thenReturn(readyTranslation); when(translationServiceMock.format("Reserved")).thenReturn(reservedTranslation); when(translationServiceMock.format("InProgress")).thenReturn(inProgressTranslation); ColumnFilter testColumFilter = in(COLUMN_STATUS, status); ActiveFilterItem activeFilterItem = getPresenter().getActiveFilterFromColumnFilter(testColumFilter); assertEquals(Constants.INSTANCE.Status(), activeFilterItem.getKey()); assertEquals("Status: Ready_t, Reserved_t, InProgress_t", activeFilterItem.getLabelValue()); assertEquals(3, ((List) activeFilterItem.getValue()).size()); assertNotEquals(testColumFilter.toString(), activeFilterItem.getLabelValue()); verify(translationServiceMock, times(3)).format(anyString()); }
@Test public void testActiveFilterLabelOther() { ColumnFilter testColumFilter = equalsTo(COLUMN_PROCESS_INSTANCE_ID, 1); ActiveFilterItem activeFilterItem = getPresenter().getActiveFilterFromColumnFilter(testColumFilter); assertEquals(COLUMN_PROCESS_INSTANCE_ID, activeFilterItem.getKey()); assertEquals(testColumFilter.toString(), activeFilterItem.getLabelValue()); testColumFilter = equalsTo(COLUMN_NAME, "columnName"); activeFilterItem = getPresenter().getActiveFilterFromColumnFilter(testColumFilter); assertEquals(COLUMN_NAME, activeFilterItem.getKey()); assertEquals(testColumFilter.toString(), activeFilterItem.getLabelValue()); }