ProductProjectionSearchImpl(final ProductProjectionType productProjectionType){ super("/product-projections/search", ProductProjectionSearch.resultTypeReference(), ProductProjectionSearchModel.of().sort(), ProductProjectionSearchModel.of().filter(), ProductProjectionSearchModel.of().facet(), ProductProjectionExpansionModel.of(), ProductProjectionSearchImpl::new, additionalParametersOf(productProjectionType)); }
ProductProjectionSearchImpl(final ProductProjectionType productProjectionType){ super("/product-projections/search", ProductProjectionSearch.resultTypeReference(), ProductProjectionSearchModel.of().sort(), ProductProjectionSearchModel.of().filter(), ProductProjectionSearchModel.of().facet(), ProductProjectionExpansionModel.of(), ProductProjectionSearchImpl::new, additionalParametersOf(productProjectionType)); }
ProductProjectionSearchImpl(final ProductProjectionType productProjectionType){ super("/product-projections/search", ProductProjectionSearch.resultTypeReference(), ProductProjectionSearchModel.of().sort(), ProductProjectionSearchModel.of().filter(), ProductProjectionSearchModel.of().facet(), ProductProjectionExpansionModel.of(), ProductProjectionSearchImpl::new, additionalParametersOf(productProjectionType)); }
private MultiValueSortSearchModel<ProductProjection> sortModel() { return ProductProjectionSearchModel.of().sort().allVariants().attribute().ofString("size"); } }
@Test public void sortByCurrentScopedPrice() { final List<PriceDraft> prices1 = asList(PriceDraft.of(EURO_20), PriceDraft.of(EURO_30).withCountry(DE)); final List<PriceDraft> prices2 = asList(PriceDraft.of(EURO_30), PriceDraft.of(EURO_40).withCountry(DE)); final SortExpression<ProductProjection> sortExpression = ProductProjectionSearchModel.of().sort().allVariants().scopedPrice().currentValue().centAmount().asc(); sortCheck(prices1, prices2, sortExpression); }
@Test public void sortByValueScopedPrice() { final List<PriceDraft> prices1 = asList(PriceDraft.of(EURO_20), PriceDraft.of(EURO_30).withCountry(DE)); final List<PriceDraft> prices2 = asList(PriceDraft.of(EURO_30), PriceDraft.of(EURO_40).withCountry(DE)); final SortExpression<ProductProjection> sortExpression = ProductProjectionSearchModel.of().sort().allVariants().scopedPrice().value().centAmount().asc(); sortCheck(prices1, prices2, sortExpression); }