AbstractTaskListPresenter extends AbstractMultiGridPresenter<TaskSummary, V> { protected String isFilteredByTaskName(List<DataSetOp> ops) { for (DataSetOp dataSetOp : ops) { if (dataSetOp.getType().equals(DataSetOpType.FILTER)) { List<ColumnFilter> filters = ((DataSetFilter) dataSetOp).getColumnFilterList(); for (ColumnFilter filter : filters) { final String taskName = isFilteredByTaskName(filter); if (taskName != null) { return taskName; } } } } return null; }  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 isFilteredByTaskNameTest() { final String taskName = "taskName"; final DataSetFilter filter = new DataSetFilter(); filter.addFilterColumn(equalsTo(COLUMN_NAME, taskName)); final String filterTaskName = getPresenter().isFilteredByTaskName(Collections.singletonList(filter)); assertEquals(taskName, filterTaskName); }
@Test public void isFilteredByTaskNameInvalidTest() { final String taskName = "taskName"; final DataSetFilter filter = new DataSetFilter(); filter.addFilterColumn(likeTo(COLUMN_DESCRIPTION, taskName)); final String filterTaskName = getPresenter().isFilteredByTaskName(Collections.singletonList(filter)); assertNull(filterTaskName); }