protected static List<String> resultsToIds(final PagedSearchResult<ProductProjection> result) { return toIds(result.getResults()); }
private static void testResult(final ProductProjectionSearch search, final Consumer<List<String>> testFilter, final Consumer<List<TermStats>> testColors, final Consumer<List<TermStats>> testSizes) { assertEventually(Duration.ofSeconds(45), Duration.ofMillis(200), () -> { final PagedSearchResult<ProductProjection> result = executeSearch(search); testFilter.accept(toIds(result.getResults())); testColors.accept(result.getFacetResult(COLOR_FACETED_SEARCH).getTerms()); testSizes.accept(result.getFacetResult(SIZE_FACETED_SEARCH).getTerms()); }); } }
private static void testProductIds(final List<FilterExpression<ProductProjection>> filterExpr, final Consumer<List<String>> test) { final ProductProjectionSearch search = ProductProjectionSearch.ofStaged().withQueryFilters(filterExpr); final List<ProductProjection> results = executeSearch(search).getResults(); test.accept(toIds(results)); } }
private static PagedSearchResult<ProductProjection> executeFacetedSearch(final FacetedSearchExpression<ProductProjection> facetedSearchExpr, final Consumer<List<String>> testFilter) { final PagedSearchResult<ProductProjection> result = executeSearch(ProductProjectionSearch.ofStaged().plusFacetedSearch(facetedSearchExpr)); testFilter.accept(toIds(result.getResults())); return result; } }
private static void testProductIds(final SortExpression<ProductProjection> sortExpr, final Consumer<List<String>> test) { final ProductProjectionSearch search = ProductProjectionSearch.ofStaged().withSort(sortExpr); final List<ProductProjection> results = executeSearch(search).getResults(); assertEventually(() -> { test.accept(toIds(results)); }); } }