Class AbstractRuleEngineServicesTest

    • Field Detail

      • RULE_ENGINGE_CONTEXT_NAME

        public static final java.lang.String RULE_ENGINGE_CONTEXT_NAME
        the default rule engine context used for tests (see corresponding impex file)
        See Also:
        Constant Field Values
      • RULE_ENGINGE_KBASE_JUNIT

        public static final java.lang.String RULE_ENGINGE_KBASE_JUNIT
        See Also:
        Constant Field Values
      • RULE_ENGINGE_KMODULE_JUNIT

        public static final java.lang.String RULE_ENGINGE_KMODULE_JUNIT
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractRuleEngineServicesTest

        public AbstractRuleEngineServicesTest()
    • Method Detail

      • provideRAOs

        protected java.util.Set<java.lang.Object> provideRAOs​(FactContext factContext)
      • buildRAOsForNotEmptyCartWithCode

        protected java.util.Set buildRAOsForNotEmptyCartWithCode​(java.lang.String code)
      • buildRAOsForCartWithCode

        protected java.util.Set buildRAOsForCartWithCode​(java.lang.String code)
      • prepareContext

        protected RuleEvaluationContext prepareContext​(java.util.Set<java.lang.Object> facts)
      • evaluateAndFailOnError

        protected RuleEvaluationResult evaluateAndFailOnError​(java.util.Set<java.lang.Object> facts)
      • buildCartWithCodeAndCurrency

        protected CartModel buildCartWithCodeAndCurrency​(java.lang.String code)
        creates a non-persistent cart with no entries and default currency USD.
        Parameters:
        code - the code to use
        Returns:
        the CartModel
      • buildNotEmptyCartWithCodeAndCurrency

        protected CartModel buildNotEmptyCartWithCodeAndCurrency​(java.lang.String code)
        creates a non-persistent not-empty cart with default currency USD.
        Parameters:
        code - the code to use
        Returns:
        the CartModel
      • getRuleForFile

        protected DroolsRuleModel getRuleForFile​(java.lang.String fileName,
                                                 java.lang.String path,
                                                 java.lang.String packageName,
                                                 java.util.Map<java.lang.String,​java.lang.String> globals)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getRuleForFile

        protected DroolsRuleModel getRuleForFile​(java.lang.String fileName,
                                                 java.lang.String path,
                                                 java.lang.String packageName,
                                                 java.util.Map<java.lang.String,​java.lang.String> globals,
                                                 RuleType ruleType)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • readRuleFile

        protected java.lang.String readRuleFile​(java.lang.String fileName,
                                                java.lang.String path)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • initializeRuleEngine

        protected void initializeRuleEngine​(DroolsRuleModel... rules)
      • createCartRAO

        protected CartRAO createCartRAO​(java.lang.String code,
                                        java.lang.String currencyIso)
      • createOrderEntryRAO

        protected OrderEntryRAO createOrderEntryRAO​(java.lang.String basePrice,
                                                    java.lang.String currencyIso,
                                                    int quantity,
                                                    int entryNumber)
      • createDeliveryModeRAO

        protected DeliveryModeRAO createDeliveryModeRAO​(java.lang.String code,
                                                        java.lang.String cost,
                                                        java.lang.String currencyIsoCode)
      • createOrderEntryRAO

        protected OrderEntryRAO createOrderEntryRAO​(CartRAO cartRao,
                                                    java.lang.String basePrice,
                                                    java.lang.String currencyIso,
                                                    int quantity,
                                                    int entryNumber)
      • getModelService

        protected ModelService getModelService()
      • getCommerceRuleEngineService

        protected RuleEngineService getCommerceRuleEngineService()
      • getPlatformRuleEngineService

        protected RuleEngineService getPlatformRuleEngineService()
      • getMediaService

        protected MediaService getMediaService()