public EnumSortSearchModel<ProductProjection, MultiValueSortSearchModel<ProductProjection>> ofEnumSet(final String attributeName) { return ofEnum(attributeName); }
public EnumSortSearchModel<ProductProjection, MultiValueSortSearchModel<ProductProjection>> ofEnumSet(final String attributeName) { return ofEnum(attributeName); }
public EnumSortSearchModel<ProductProjection, MultiValueSortSearchModel<ProductProjection>> ofEnumSet(final String attributeName) { return ofEnum(attributeName); }
@Test public void onEnumLabelAttributes() throws Exception { testProductIds(PRODUCT_MODEL.allVariants().attribute().ofEnum(ATTR_NAME_ENUM).label().asc(), ids -> assertThat(ids).containsExactly(product2.getId(), product1.getId())); }
@Test public void canAccessEnumLabelCustomAttributes() throws Exception { final String attrName = "originCountry"; assertThat(FACET_ATTR.ofEnum(attrName).label().allTerms().expression()).isEqualTo("variants.attributes.originCountry.label"); assertThat(FILTER_ATTR.ofEnum(attrName).label().is("Italy")).extracting(expression()).containsExactly("variants.attributes.originCountry.label:\"Italy\""); assertThat(SORT_ATTR.ofEnum(attrName).label().ascWithMaxValue().expression()).isEqualTo("variants.attributes.originCountry.label asc.max"); }
@Test public void onEnumKeyAttributes() throws Exception { testProductIds(PRODUCT_MODEL.allVariants().attribute().ofEnum(ATTR_NAME_ENUM).key().asc(), ids -> assertThat(ids).containsExactly(product2.getId(), product1.getId())); }
@Test public void canAccessEnumKeyCustomAttributes() throws Exception { final String attrName = "originCountry"; assertThat(FACET_ATTR.ofEnum(attrName).key().allTerms().expression()).isEqualTo("variants.attributes.originCountry.key"); assertThat(FILTER_ATTR.ofEnum(attrName).key().is("Italy")).extracting(expression()).containsExactly("variants.attributes.originCountry.key:\"Italy\""); assertThat(SORT_ATTR.ofEnum(attrName).key().descWithMinValue().expression()).isEqualTo("variants.attributes.originCountry.key desc.min"); }