private List<QueryRequest> getQueryRequests( Stream<List<QueryMetacardImpl>> queriesGroupedBySource) { final Filter modifiedFilter = filterService.getModifiedDateFilter(calculateQueryTimeInterval()); return queriesGroupedBySource .map(this::queryMetacardsToFilters) .map(filterBuilder::anyOf) .map(filter -> filterBuilder.allOf(modifiedFilter, filter)) .map(this::filterToQuery) .map(this::queryToQueryRequest) .collect(Collectors.toList()); }
@Test public void testSearchBoth() throws StopProcessingException, PluginExecutionException, UnsupportedQueryException { QueryImpl query = new QueryImpl( filterBuilder.allOf( filterBuilder.attribute(VALIDATION_WARNINGS).is().empty(), filterBuilder.attribute(VALIDATION_WARNINGS).is().equalTo().text("sample"))); QueryRequest returnQuery = metacardValidityCheckerPlugin.process(new QueryRequestImpl(query)); assertThat(filterAdapter.adapt(returnQuery.getQuery(), testValidationQueryDelegate), is(true)); }