AbstractTaskListPresenter extends AbstractMultiGridPresenter<TaskSummary, V> { @Override public void setupActiveSearchFilters() { final Optional<String> processInstIdSearch = getSearchParameter(PerspectiveIds.SEARCH_PARAMETER_PROCESS_INSTANCE_ID); if (processInstIdSearch.isPresent()) { final String processInstId = processInstIdSearch.get(); addActiveFilter( equalsTo(COLUMN_PROCESS_INSTANCE_ID, Integer.valueOf(processInstId)), constants.Process_Instance_Id(), processInstId, Integer.valueOf(processInstId), v -> removeActiveFilter(equalsTo(COLUMN_PROCESS_INSTANCE_ID, v)) ); } else { final Optional<String> taskIdSearch = getSearchParameter(PerspectiveIds.SEARCH_PARAMETER_TASK_ID); if (taskIdSearch.isPresent()) { final String taskId = taskIdSearch.get(); addActiveFilter( equalsTo(COLUMN_TASK_ID, Integer.valueOf(taskId)), constants.Task(), taskId, Integer.valueOf(taskId), v -> removeActiveFilter(equalsTo(COLUMN_TASK_ID, v)) ); } } }  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 testActiveSearchFiltersProcessInstanceId() { final PlaceRequest place = mock(PlaceRequest.class); final String processInstanceId = "1"; when(place.getParameter(SEARCH_PARAMETER_PROCESS_INSTANCE_ID, null)).thenReturn(processInstanceId); getPresenter().onStartup(place); getPresenter().setupActiveSearchFilters(); ArgumentCaptor<ActiveFilterItem> captor = ArgumentCaptor.forClass(ActiveFilterItem.class); verify(viewMock).addActiveFilter(captor.capture()); final ActiveFilterItem filterItem = captor.getValue(); assertNotNull(filterItem); assertEquals(Constants.INSTANCE.Process_Instance_Id(), filterItem.getKey()); assertEquals(1, filterItem.getValue()); assertEquals(Constants.INSTANCE.Process_Instance_Id() + ": " + processInstanceId, filterItem.getLabelValue()); }
@Test public void testSetUpActiveSearchByTaskIdFilters() { final PlaceRequest place = mock(PlaceRequest.class); final String taskId = "1"; when(place.getParameter(SEARCH_PARAMETER_TASK_ID, null)).thenReturn(taskId); getPresenter().onStartup(place); getPresenter().setupActiveSearchFilters(); ArgumentCaptor<ActiveFilterItem> captor = ArgumentCaptor.forClass(ActiveFilterItem.class); verify(viewMock).addActiveFilter(captor.capture()); final ActiveFilterItem filterItem = captor.getValue(); assertNotNull(filterItem); assertEquals(Constants.INSTANCE.Task(), filterItem.getKey()); assertEquals(1, filterItem.getValue()); assertEquals(Constants.INSTANCE.Task() + ": " + taskId, filterItem.getLabelValue()); }