public LocalizedEnumSortSearchModel<ProductProjection, MultiValueSortSearchModel<ProductProjection>> ofLocalizedEnumSet(final String attributeName) { return ofLocalizedEnum(attributeName); }
public LocalizedEnumSortSearchModel<ProductProjection, MultiValueSortSearchModel<ProductProjection>> ofLocalizedEnumSet(final String attributeName) { return ofLocalizedEnum(attributeName); }
public LocalizedEnumSortSearchModel<ProductProjection, MultiValueSortSearchModel<ProductProjection>> ofLocalizedEnumSet(final String attributeName) { return ofLocalizedEnum(attributeName); }
@Test public void onLocEnumKeyAttributes() throws Exception { testProductIds(PRODUCT_MODEL.allVariants().attribute().ofLocalizedEnum(ATTR_NAME_LOC_ENUM).key().asc(), ids -> assertThat(ids).containsExactly(product2.getId(), product1.getId())); }
@Test public void canAccessLocEnumKeyCustomAttributes() throws Exception { final String attrName = "color"; assertThat(FACET_ATTR.ofLocalizedEnum(attrName).key().allTerms().expression()).isEqualTo("variants.attributes.color.key"); assertThat(FILTER_ATTR.ofLocalizedEnum(attrName).key().is("ROT")).extracting(expression()).containsExactly("variants.attributes.color.key:\"ROT\""); assertThat(SORT_ATTR.ofLocalizedEnum(attrName).key().descWithMinValue().expression()).isEqualTo("variants.attributes.color.key desc.min"); }
@Test public void onLocEnumLabelAttributes() throws Exception { testProductIds(PRODUCT_MODEL.allVariants().attribute().ofLocalizedEnum(ATTR_NAME_LOC_ENUM).label().locale(GERMAN).asc(), ids -> assertThat(ids).containsExactly(product2.getId(), product1.getId())); }
@Test public void canAccessLocEnumLabelCustomAttributes() throws Exception { final String attrName = "color"; assertThat(FACET_ATTR.ofLocalizedEnum(attrName).label().locale(ENGLISH).allTerms().expression()).isEqualTo("variants.attributes.color.label.en"); assertThat(FILTER_ATTR.ofLocalizedEnum(attrName).label().locale(ENGLISH).is("red")).extracting(expression()).containsExactly("variants.attributes.color.label.en:\"red\""); assertThat(SORT_ATTR.ofLocalizedEnum(attrName).label().locale(ENGLISH).ascWithMaxValue().expression()).isEqualTo("variants.attributes.color.label.en asc.max"); }