ExecutionErrorListPresenter extends AbstractMultiGridPresenter<ExecutionErrorSummary, ExecutionErrorListPresenter.ExecutionErrorListView> { @Override public void setupActiveSearchFilters() { final Optional<String> processInstanceSearch = getSearchParameter(PerspectiveIds.SEARCH_PARAMETER_PROCESS_INSTANCE_ID); if (processInstanceSearch.isPresent()) { final String processInstanceId = processInstanceSearch.get(); addActiveFilter(equalsTo(COLUMN_PROCESS_INST_ID, Integer.valueOf(processInstanceId)), constants.Process_Instance_Id(), processInstanceId, Integer.valueOf(processInstanceId), v -> removeActiveFilter(equalsTo(COLUMN_PROCESS_INST_ID, v)) ); } final Optional<String> taskIdSearch = getSearchParameter(PerspectiveIds.SEARCH_PARAMETER_TASK_ID); if (taskIdSearch.isPresent()) { final String taskId = taskIdSearch.get(); addActiveFilter(equalsTo(COLUMN_ACTIVITY_ID, Integer.valueOf(taskId)), constants.Task(), taskId, Integer.valueOf(taskId), v -> removeActiveFilter(equalsTo(COLUMN_ACTIVITY_ID, v)) ); } final Optional<String> errorTypeSearch = getSearchParameter(PerspectiveIds.SEARCH_PARAMETER_ERROR_TYPE); if (errorTypeSearch.isPresent()) { final String errorType = errorTypeSearch.get(); addActiveFilter(equalsTo(COLUMN_ERROR_TYPE, errorType), constants.Type(), errorType, errorType, v -> removeActiveFilter(equalsTo(COLUMN_ERROR_TYPE, v)) ); } final Optional<String> isErrorAckSearch = getSearchParameter(PerspectiveIds.SEARCH_PARAMETER_IS_ERROR_ACK); if (isErrorAckSearch.isPresent()) { final boolean isErrorAck = isErrorAckSearch.get().equalsIgnoreCase(Boolean.toString(true)); Integer errorAckValue = (isErrorAck ? 1 : 0); String valueLabel = (isErrorAck ? commonConstants.Yes() : commonConstants.No()); addActiveFilter( equalsTo(COLUMN_ERROR_ACK, errorAckValue), constants.Acknowledged(), valueLabel, errorAckValue, v -> removeActiveFilter(equalsTo(COLUMN_ERROR_ACK, v)) ); } }  void createListBreadcrumb(); void setupDetailBreadcrumb(String detailLabel); void acknowledgeExecutionError(final String executionErrorId,
                                          final String deploymentId); void goToJob(ExecutionErrorSummary errorSummary); Predicate<ExecutionErrorSummary> getAcknowledgeActionCondition(); Predicate<ExecutionErrorSummary> getViewJobActionCondition(); Predicate<ExecutionErrorSummary> getViewProcessInstanceActionCondition(); Predicate<ExecutionErrorSummary> getViewTaskActionCondition(); void goToProcessInstance(final ExecutionErrorSummary errorSummary); void goToTask(final ExecutionErrorSummary errorSummary); void bulkAcknowledge(List<ExecutionErrorSummary> execErrorsSelected); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); @Override void selectSummaryItem(final ExecutionErrorSummary summary); @Inject void setFilterSettingsManager(final ExecutionErrorListFilterSettingsManager filterSettingsManager); @Inject void setExecutorService(final Caller<ExecutorService> executorService); @Override void setupActiveSearchFilters(); @Override boolean existActiveSearchFilters(); @Override ActiveFilterItem getActiveFilterFromColumnFilter(ColumnFilter columnFilter); String getStatusColumnFilterDescription(ColumnFilter columnFilter); String getTypeColumnFilterDescription(ColumnFilter columnFilter); void setExecutionErrorSelectedEvent(Event<ExecutionErrorSelectedEvent> executionErrorSelectedEvent);  }
@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); presenter.onStartup(place); presenter.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()); }