Source:
public void declareIntermediateRuleFromSimplePredicateNotFinalLeaf() { final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap = new HashMap<>(); SimplePredicate simplePredicate = getSimplePredicate("outlook", DataType.STRING, "VALUE", SimplePredicate.Operator.LESS_THAN, fieldTypeMap); String parentPath = "_will play"; String currentRule = "_will play_will play"; String declaredType = fieldTypeMap.get("outlook").getGeneratedType(); String result = "RESULT"; final List<KiePMMLDroolsRule> rules = new ArrayList<>(); PredicateASTFactoryData predicateASTFactoryData = getPredicateASTFactoryData(simplePredicate, Collections.emptyList(), rules, parentPath, currentRule, fieldTypeMap); KiePMMLSimplePredicateASTFactory.factory(predicateASTFactoryData).declareRuleFromSimplePredicate(result, false); assertEquals(1, rules.size()); final KiePMMLDroolsRule retrieved = rules.get(0); assertNotNull(retrieved); assertEquals(currentRule, retrieved.getName()); assertEquals(currentRule, retrieved.getStatusToSet()); assertEquals(String.format(KiePMMLAbstractModelASTFactory.STATUS_PATTERN, parentPath), retrieved.getStatusConstraint()); assertEquals(currentRule, retrieved.getStatusToSet()); final List<KiePMMLFieldOperatorValue> andConstraints = retrieved.getAndConstraints(); assertNotNull(andConstraints); assertEquals(1, andConstraints.size()); KiePMMLFieldOperatorValue kiePMMLFieldOperatorValue = retrieved.getAndConstraints().get(0); assertEquals(declaredType, kiePMMLFieldOperatorValue.getName()); assertEquals("and", kiePMMLFieldOperatorValue.getOperator()); String expectedValue = "value < \"" + simplePredicate.getValue() + "\""; assertEquals(expectedValue, kiePMMLFieldOperatorValue.getConstraintsAsString()); }

Target:
public void declareIntermediateRuleFromSimplePredicateNotFinalLeaf() { final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap = new HashMap<>(); SimplePredicate simplePredicate = getSimplePredicate("outlook", DataType.STRING, "VALUE", SimplePredicate.Operator.LESS_THAN, fieldTypeMap); String parentPath = "_will play"; String currentRule = "_will play_will play"; String declaredType = fieldTypeMap.get("outlook").getGeneratedType(); String result = "RESULT"; final List<KiePMMLDroolsRule> rules = new ArrayList<>(); PredicateASTFactoryData predicateASTFactoryData = getPredicateASTFactoryData(simplePredicate, Collections.emptyList(), rules, parentPath, currentRule, fieldTypeMap); KiePMMLSimplePredicateASTFactory.factory(predicateASTFactoryData).declareRuleFromSimplePredicate(result, false); assertEquals(1, rules.size()); final KiePMMLDroolsRule retrieved = rules.get(0); assertNotNull(retrieved); assertEquals(currentRule, retrieved.getName()); assertEquals(currentRule, retrieved.getStatusToSet()); assertEquals(String.format(KiePMMLAbstractModelASTFactory.STATUS_PATTERN, parentPath), retrieved.getStatusConstraint()); assertEquals(currentRule, retrieved.getStatusToSet()); final List<KiePMMLFieldOperatorValue> andConstraints = retrieved.getAndConstraints(); assertNotNull(andConstraints); assertEquals(1, andConstraints.size()); KiePMMLFieldOperatorValue kiePMMLFieldOperatorValue = retrieved.getAndConstraints().get(0); assertEquals(declaredType, kiePMMLFieldOperatorValue.getName()); assertEquals(BOOLEAN_OPERATOR.AND, kiePMMLFieldOperatorValue.getOperator()); String expectedValue = "value < \"" + simplePredicate.getValue() + "\""; assertEquals(expectedValue, kiePMMLFieldOperatorValue.getConstraintsAsString()); }