CommerceUtils { public static boolean isMultipleQuantityAllowedForServices(JsonNode websiteSettings) { boolean defaultValue = true; String fieldName = "multipleQuantityAllowedForServices"; JsonNode storeSettings = websiteSettings.get("storeSettings"); if (storeSettings == null || !storeSettings.hasNonNull(fieldName)) { return defaultValue; } return storeSettings.get(fieldName).asBoolean(defaultValue); } private  CommerceUtils(); static boolean useCLDRMode(Context ctx); static ProductType getProductType(JsonNode item); static boolean isSubscribable(JsonNode item); static JsonNode getSubscriptionPlanBillingPeriodNode(JsonNode item); static String getUnitFromSubscriptionPlanBillingPeriod(JsonNode billingPeriodNode); static int getValueFromSubscriptionPlanBillingPeriod(JsonNode billingPeriodNode); static int getNumBillingCyclesFromSubscriptionPlanNode(JsonNode item); static JsonNode getLowestPriceAmongVariants(JsonNode item); static JsonNode getHighestPriceAmongVariants(JsonNode item); static JsonNode getSalePriceMoneyNode(JsonNode item); static Decimal getAmountFromMoneyNode(JsonNode moneyNode); static String getCurrencyFromMoneyNode(JsonNode moneyNode); static Decimal getLegacyPriceFromMoneyNode(JsonNode moneyNode); static double getTotalStockRemaining(JsonNode item); static boolean hasVariedPrices(JsonNode item); static boolean hasVariants(JsonNode item); static boolean isOnSale(JsonNode item); static boolean isSoldOut(JsonNode item); static void writeLegacyMoneyString(Decimal value, StringBuilder buf); static void writeVariantFormat(JsonNode variant, StringBuilder buf); static ArrayNode getItemVariantOptions(JsonNode item); static boolean isMultipleQuantityAllowedForServices(JsonNode websiteSettings);  }
@Test public void testIsMultipleQuantityAllowedForServices() { Map<String, JsonNode> jsonMap = loadJson(getClass(), "is-multi-quantity-allowed-for-services.json"); for (Map.Entry<String, JsonNode> entry : jsonMap.entrySet()) { String key = entry.getKey(); assertEquals(isMultipleQuantityAllowedForServices(entry.getValue()), key.endsWith("-true"), key); } }