use of org.broadleafcommerce.common.locale.domain.LocaleImpl in project BroadleafCommerce by BroadleafCommerce.
the class MvelHelperTest method testRuleThatEvaluatesToTrue.
/**
* Test rule that evaluates to true
*/
public void testRuleThatEvaluatesToTrue() {
// Locale used as an illustrative domain class only. Any object could have been used.
Locale testLocale = new LocaleImpl();
testLocale.setLocaleCode("US");
Map parameters = new HashMap();
parameters.put("locale", testLocale);
boolean result = MvelHelper.evaluateRule("locale.localeCode == 'US'", parameters);
assertTrue(result);
}
use of org.broadleafcommerce.common.locale.domain.LocaleImpl in project BroadleafCommerce by BroadleafCommerce.
the class MvelHelperTest method testRuleThatEvaluatesToFalse.
/**
* Test rule that evaluates to true
*/
public void testRuleThatEvaluatesToFalse() {
// Locale used as an illustrative domain class only. Any object could have been used.
Locale testLocale = new LocaleImpl();
testLocale.setLocaleCode("GB");
Map parameters = new HashMap();
parameters.put("locale", testLocale);
boolean result = MvelHelper.evaluateRule("locale.localeCode == 'US'", parameters);
assertFalse(result);
}
Aggregations