Class RuleFieldValidatorTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.broadleafcommerce.admin.web.rulebuilder.RuleFieldValidatorTest
- All Implemented Interfaces:
junit.framework.Test
public class RuleFieldValidatorTest
extends junit.framework.TestCase
Tests the checks
RuleFieldValidator applies to the mvel translated from the rule builder-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidsetUp()voidQuantity based rules are checked after the quotes are unescaped, the way they are storedvoidRaw mvel is stored as is for new quantity based rules, so it must be checked toovoidThe proof of concept from the report, saved as a customer offer rule.voidvoidMethods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, tearDown, toString
-
Constructor Details
-
RuleFieldValidatorTest
public RuleFieldValidatorTest()
-
-
Method Details
-
setUp
protected void setUp()- Overrides:
setUpin classjunit.framework.TestCase
-
testRuleBuilderRulesAreAllowed
public void testRuleBuilderRulesAreAllowed() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException- Throws:
org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
-
testReportedPayload
public void testReportedPayload() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationExceptionThe proof of concept from the report, saved as a customer offer rule. The translator escapes the value, so it is a harmless string literal, while the mvel it produced before the value was escaped is rejected.- Throws:
org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
-
testStatementSeparatorIsRejected
public void testStatementSeparatorIsRejected() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException- Throws:
org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
-
testRawMvelIsChecked
public void testRawMvelIsChecked()Raw mvel is stored as is for new quantity based rules, so it must be checked too -
testQuantityRuleIsCheckedAsStored
public void testQuantityRuleIsCheckedAsStored()Quantity based rules are checked after the quotes are unescaped, the way they are stored
-