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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    void
    Quantity based rules are checked after the quotes are unescaped, the way they are stored
    void
    Raw mvel is stored as is for new quantity based rules, so it must be checked too
    void
    The proof of concept from the report, saved as a customer offer rule.
    void
     
    void
     

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RuleFieldValidatorTest

      public RuleFieldValidatorTest()
  • Method Details

    • setUp

      protected void setUp()
      Overrides:
      setUp in class junit.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.MVELTranslationException
      The 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