RequestListPresenter extends AbstractMultiGridPresenter<RequestSummary, RequestListPresenter.RequestListView> { @Override public boolean existActiveSearchFilters() { final Optional<String> processInstIdSearch = getSearchParameter(PerspectiveIds.SEARCH_PARAMETER_PROCESS_INSTANCE_ID); if (processInstIdSearch.isPresent()) { return true; } final Optional<String> jobSearch = getSearchParameter(PerspectiveIds.SEARCH_PARAMETER_JOB_ID); if (jobSearch.isPresent()) { return true; } return false; } 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 testExistActiveSearchFilters() { final PlaceRequest place = mock(PlaceRequest.class); presenter.onStartup(place); when(place.getParameter(SEARCH_PARAMETER_PROCESS_INSTANCE_ID, null)).thenReturn("1"); assertTrue(presenter.existActiveSearchFilters()); when(place.getParameter(SEARCH_PARAMETER_JOB_ID, null)).thenReturn("1"); assertTrue(presenter.existActiveSearchFilters()); when(place.getParameter(SEARCH_PARAMETER_PROCESS_INSTANCE_ID, null)).thenReturn(null); when(place.getParameter(SEARCH_PARAMETER_JOB_ID, null)).thenReturn(null); assertFalse(presenter.existActiveSearchFilters()); }