ShopEntity implements org.yes.cart.domain.entity.Shop, java.io.Serializable { protected Set<String> getCsvValuesTrimmedAsSet(final String attributeKey) { final List<String> csv = getCsvValuesTrimmedAsList(attributeKey); if (CollectionUtils.isNotEmpty(csv)) { return Collections.unmodifiableSet(new HashSet<>(csv)); } return Collections.emptySet(); } ShopEntity(); @Override String getCode(); @Override void setCode(final String code); @Override String getName(); @Override void setName(final String name); @Override String getDescription(); @Override void setDescription(final String description); @Override String getFspointer(); @Override void setFspointer(final String fspointer); @Override boolean isDisabled(); @Override void setDisabled(final boolean disabled); @Override Shop getMaster(); @Override void setMaster(final Shop master); @Override Set<ShopUrl> getShopUrl(); @Override void setShopUrl(final Set<ShopUrl> shopUrl); @Override Set<ShopAlias> getShopAlias(); @Override void setShopAlias(final Set<ShopAlias> shopAlias); @Override Collection<ShopAdvPlace> getAdvertisingPlaces(); @Override void setAdvertisingPlaces(final Collection<ShopAdvPlace> advertisingPlaces); @Override Collection<AttrValueShop> getAttributes(); @Override void setAttributes(final Collection<AttrValueShop> attributes); @Override Collection<AttrValue> getAllAttributes(); @Override Map<String, AttrValue> getAllAttributesAsMap(); SeoEntity getSeoInternal(); void setSeoInternal(final SeoEntity seo); @Override Collection<ShopCategory> getShopCategory(); @Override void setShopCategory(final Collection<ShopCategory> shopCategory); @Override Instant getCreatedTimestamp(); @Override void setCreatedTimestamp(final Instant createdTimestamp); @Override Instant getUpdatedTimestamp(); @Override void setUpdatedTimestamp(final Instant updatedTimestamp); @Override String getCreatedBy(); @Override void setCreatedBy(final String createdBy); @Override String getUpdatedBy(); @Override void setUpdatedBy(final String updatedBy); @Override String getGuid(); @Override void setGuid(final String guid); @Override long getShopId(); @Override long getId(); @Override void setShopId(final long shopId); @Override long getVersion(); void setVersion(final long version); @Override String getSupportedCurrencies(); @Override String getDefaultCurrency(); @Override List<String> getSupportedCurrenciesAsList(); @Override String getSupportedShippingCountries(); @Override List<String> getSupportedShippingCountriesAsList(); @Override String getSupportedBillingCountries(); @Override List<String> getSupportedBillingCountriesAsList(); @Override String getSupportedLanguages(); @Override List<String> getSupportedLanguagesAsList(); @Override String getAddressFormatByCountryAndLocaleAndCustomerTypeAndAddressType(final String countryCode, final String locale, final String customerType, final String addressType); @Override String getSupportedRegistrationFormAttributes(final String customerType); @Override List<String> getSupportedRegistrationFormAttributesAsList(final String customerType); @Override String getSupportedProfileFormAttributes(final String customerType); @Override List<String> getSupportedProfileFormAttributesAsList(final String customerType); @Override String getSupportedProfileFormReadOnlyAttributes(final String customerType); @Override List<String> getSupportedProfileFormReadOnlyAttributesAsList(final String customerType); @Override String getProductStoredAttributes(); @Override List<String> getProductStoredAttributesAsList(); @Override String getDisabledCarrierSla(); @Override Set<Long> getDisabledCarrierSlaAsSet(); @Override String getSupportedCarrierSlaRanks(); @Override Map<Long, Integer> getSupportedCarrierSlaRanksAsMap(); @Override Collection<AttrValueShop> getAttributesByCode(final String attributeCode); @Override AttrValueShop getAttributeByCode(final String attributeCode); @Override String getAttributeValueByCode(final String attributeCode); @Override boolean isAttributeValueByCodeTrue(final String attributeCode); @Override boolean isB2BProfileActive(); @Override boolean isB2BAddressBookActive(); @Override boolean isB2BStrictPriceActive(); @Override boolean isSfPageTraceOn(); @Override boolean isSfRequireCustomerLogin(); @Override boolean isSfRequireCustomerRegistrationApproval(final String customerType); @Override boolean isSfRequireCustomerRegistrationNotification(final String customerType); @Override boolean isSfRequireCustomerOrderApproval(final String customerType); @Override boolean isSfBlockCustomerCheckout(final String customerType); @Override boolean isSfRepeatOrdersEnabled(final String customerType); @Override boolean isSfShoppingListsEnabled(final String customerType); @Override boolean isSfManagedListsEnabled(final String customerType); @Override boolean isSfB2BOrderLineRemarksEnabled(final String customerType); @Override boolean isSfB2BOrderFormEnabled(final String customerType); @Override boolean isSfRFQEnabled(final String customerType); @Override boolean isSfPromoCouponsEnabled(final String customerType); @Override boolean isSfOrderMessageEnabled(final String customerType); @Override boolean isSfAddressBookEnabled(final String customerType); @Override boolean isSfAddressBookBillingEnabled(final String customerType); @Override boolean isSfShowTaxInfo(final String customerType); @Override boolean isSfShowTaxNet(final String customerType); @Override boolean isSfShowTaxAmount(final String customerType); @Override boolean isSfShowTaxOptions(final String customerType); @Override boolean isSfShowSameBillingAddressDisabledTypes(final String customerType); @Override boolean isSfDeleteAccountDisabled(final String customerType); @Override boolean isSfHidePricesTypes(final String customerType); @Override Boolean isSfManagersLoginEnabled(); @Override String getDefaultShopUrl(); @Override String getDefaultShopSecureUrl(); @Override String getDefaultShopPreferredUrl(); @Override Seo getSeo(); @Override void setSeo(final Seo seo); int hashCode(); @Override String toString();  }
@Test public void testGetCsvValuesTrimmedAsSet() throws Exception { final ShopEntity shopEntity = new ShopEntity(); final AttrValueShop av = context.mock(AttrValueShop.class, "av"); shopEntity.setAttributes(Collections.singletonList(av)); context.checking(new Expectations() {{ allowing(av).getAttributeCode(); will(returnValue("attr")); allowing(av).getVal();will(returnValue(" abc , bcd \t,\tcde,\n\n,\n\n,\t,def\n, bcd,def\n")); }}); final Set<String> csv = shopEntity.getCsvValuesTrimmedAsSet("attr"); assertNotNull(csv); assertEquals(4, csv.size()); assertTrue(csv.contains("abc")); assertTrue(csv.contains("bcd")); assertTrue(csv.contains("cde")); assertTrue(csv.contains("def")); }