public MoneySortSearchModel<ProductProjection, MultiValueSortSearchModel<ProductProjection>> ofMoneySet(final String attributeName) { return ofMoney(attributeName); }
public MoneySortSearchModel<ProductProjection, MultiValueSortSearchModel<ProductProjection>> ofMoneySet(final String attributeName) { return ofMoney(attributeName); }
public MoneySortSearchModel<ProductProjection, MultiValueSortSearchModel<ProductProjection>> ofMoneySet(final String attributeName) { return ofMoney(attributeName); }
@Test public void onMoneyAmountAttributes() throws Exception { testProductIds(PRODUCT_MODEL.allVariants().attribute().ofMoney(ATTR_NAME_MONEY).centAmount().desc(), ids -> assertThat(ids).containsExactly(product2.getId(), product1.getId())); }
@Test public void onMoneyCurrencyAttributes() throws Exception { testProductIds(PRODUCT_MODEL.allVariants().attribute().ofMoney(ATTR_NAME_MONEY).currency().desc(), ids -> assertThat(ids).containsExactly(product2.getId(), product1.getId())); }
@Test public void canAccessMoneyCentAmountCustomAttributes() throws Exception { final String attrName = "originalPrice"; assertThat(FACET_ATTR.ofMoney(attrName).centAmount().allTerms().expression()).isEqualTo("variants.attributes.originalPrice.centAmount"); assertThat(FILTER_ATTR.ofMoney(attrName).centAmount().is(1000L)).extracting(expression()).containsExactly("variants.attributes.originalPrice.centAmount:1000"); assertThat(SORT_ATTR.ofMoney(attrName).centAmount().ascWithMaxValue().expression()).isEqualTo("variants.attributes.originalPrice.centAmount asc.max"); }
@Test public void canAccessCurrencyCustomAttributes() throws Exception { final String attrName = "originalPrice"; assertThat(FACET_ATTR.ofMoney(attrName).currency().allTerms().expression()).isEqualTo("variants.attributes.originalPrice.currencyCode"); assertThat(FILTER_ATTR.ofMoney(attrName).currency().is(currency("EUR"))).extracting(expression()).containsExactly("variants.attributes.originalPrice.currencyCode:\"EUR\""); assertThat(SORT_ATTR.ofMoney(attrName).currency().descWithMinValue().expression()).isEqualTo("variants.attributes.originalPrice.currencyCode desc.min"); }