@Test public void onNumberSetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofNumberSet(ATTR_NAME_NUMBER_SET).allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of("5.0", 2L), TermStats.of("10.0", 1L))); }
@Test public void onDateSetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofDateSet(ATTR_NAME_DATE_SET).allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of("2001-09-11", 2L), TermStats.of("2002-10-12", 1L))); }
@Test public void onTextSetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofStringSet(ATTR_NAME_TEXT_SET).allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of(TEXT_FOO, 2L), TermStats.of(TEXT_BAR, 1L))); }
@Test public void onDatetimeSetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofDateTimeSet(ATTR_NAME_DATE_TIME_SET).allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of("2001-09-11T22:05:09.203+0000", 2L), TermStats.of("2002-10-12T23:06:10.204+0000", 1L))); }
@Test public void onMoneyAmountSetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofMoneySet(ATTR_NAME_MONEY_SET).centAmount().allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of("50000", 2L), TermStats.of("100000", 1L))); }
@Test public void onMoneyCurrencySetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofMoneySet(ATTR_NAME_MONEY_SET).currency().allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of("EUR", 2L), TermStats.of("USD", 1L))); }
@Test public void onLocTextSetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofLocalizedStringSet(ATTR_NAME_LOC_TEXT_SET).locale(ENGLISH).allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of(LOC_TEXT_FOO.get(ENGLISH), 2L), TermStats.of(LOC_TEXT_BAR.get(ENGLISH), 1L))); }
@Test public void onEnumKeySetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofEnumSet(ATTR_NAME_ENUM_SET).key().allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of(ENUM_TWO.getKey(), 2L), TermStats.of(ENUM_THREE.getKey(), 1L))); }
@Test public void onEnumLabelSetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofEnumSet(ATTR_NAME_ENUM_SET).label().allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of(ENUM_TWO.getLabel(), 2L), TermStats.of(ENUM_THREE.getLabel(), 1L))); }
@Test public void onLocEnumKeySetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofLocalizedEnumSet(ATTR_NAME_LOC_ENUM_SET).key().allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of(LOC_ENUM_TWO.getKey(), 2L), TermStats.of(LOC_ENUM_THREE.getKey(), 1L))); }
@Test public void onReferenceSetAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofReferenceSet(ATTR_NAME_REF_SET).id().allTerms(), termStats -> assertThat(termStats).containsExactly( TermStats.of(productA.getId(), 2L), TermStats.of(productB.getId(), 1L))); }
@Test public void onBooleanAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofBoolean(ATTR_NAME_BOOLEAN).allTerms(), termStats -> assertThat(termStats).containsOnly( TermStats.of(BOOL_TRUE, 1L), TermStats.of(BOOL_FALSE, 1L))); }
@Test public void onTextAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofString(ATTR_NAME_TEXT).allTerms(), termStats -> assertThat(termStats).containsOnly( TermStats.of(TEXT_FOO, 1L), TermStats.of(TEXT_BAR, 1L))); }
@Test public void onNumberAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofNumber(ATTR_NAME_NUMBER).allTerms(), termStats -> assertThat(termStats).containsOnly( TermStats.of("5.0", 1L), TermStats.of("10.0", 1L))); }
@Test public void onDatetimeAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofDateTime(ATTR_NAME_DATE_TIME).allTerms(), termStats -> assertThat(termStats).containsOnly( TermStats.of("2002-10-12T23:06:10.204+0000", 1L), TermStats.of("2001-09-11T22:05:09.203+0000", 1L))); }
@Test public void onMoneyCurrencyAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofMoney(ATTR_NAME_MONEY).currency().allTerms(), termStats -> assertThat(termStats).containsOnly( TermStats.of("EUR", 1L), TermStats.of("USD", 1L))); }
@Test public void onMoneyAmountAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofMoney(ATTR_NAME_MONEY).centAmount().allTerms(), termStats -> assertThat(termStats).containsOnly( TermStats.of("50000", 1L), TermStats.of("100000", 1L))); }
@Test public void onLocTextAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofLocalizedString(ATTR_NAME_LOC_TEXT).locale(ENGLISH).allTerms(), termStats -> assertThat(termStats).containsOnly( TermStats.of(LOC_TEXT_FOO.get(ENGLISH), 1L), TermStats.of(LOC_TEXT_BAR.get(ENGLISH), 1L))); }
@Test public void onEnumKeyAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofEnum(ATTR_NAME_ENUM).key().allTerms(), termStats -> assertThat(termStats).containsOnly( TermStats.of(ENUM_TWO.getKey(), 1L), TermStats.of(ENUM_THREE.getKey(), 1L))); }
@Test public void onLocEnumLabelAttributes() throws Exception { testTermStats(FACET.allVariants().attribute().ofLocalizedEnum(ATTR_NAME_LOC_ENUM).label().locale(GERMAN).allTerms(), termStats -> assertThat(termStats).containsOnly( TermStats.of(LOC_ENUM_TWO.getLabel().get(GERMAN), 1L), TermStats.of(LOC_ENUM_THREE.getLabel().get(GERMAN), 1L))); }