use of org.kie.dmn.model.api.HitPolicy in project drools by kiegroup.
the class RecommenderHitPolicyTest method testNoGapsOverlapsDiffValue.
@Test
public void testNoGapsOverlapsDiffValue() {
List<HitPolicy> wrongHPs = Arrays.asList(HitPolicy.UNIQUE, HitPolicy.ANY, HitPolicy.FIRST);
for (HitPolicy hp : wrongHPs) {
List<DMNMessage> validate = getRecommenderHitPolicy4(hp);
assertTrue(validate.stream().anyMatch(m -> m.getMessageType() == DMNMessageType.DECISION_TABLE_HITPOLICY_RECOMMENDER));
}
List<DMNMessage> validate = getRecommenderHitPolicy4(HitPolicy.PRIORITY);
assertTrue(validate.stream().noneMatch(m -> m.getMessageType() == DMNMessageType.DECISION_TABLE_HITPOLICY_RECOMMENDER));
}
use of org.kie.dmn.model.api.HitPolicy in project drools by kiegroup.
the class RecommenderHitPolicyTest method testNoGapsNoOverlaps.
@Test
public void testNoGapsNoOverlaps() {
List<HitPolicy> wrongHPs = Arrays.asList(HitPolicy.ANY, HitPolicy.PRIORITY, HitPolicy.FIRST);
for (HitPolicy hp : wrongHPs) {
List<DMNMessage> validate = getRecommenderHitPolicy2(hp);
assertTrue(validate.stream().anyMatch(m -> m.getMessageType() == DMNMessageType.DECISION_TABLE_HITPOLICY_RECOMMENDER));
}
List<DMNMessage> validate = getRecommenderHitPolicy2(HitPolicy.UNIQUE);
assertTrue(validate.stream().noneMatch(m -> m.getMessageType() == DMNMessageType.DECISION_TABLE_HITPOLICY_RECOMMENDER));
}
use of org.kie.dmn.model.api.HitPolicy in project drools by kiegroup.
the class RecommenderHitPolicyTest method testNoGapsOverlapsSameValue.
@Test
public void testNoGapsOverlapsSameValue() {
List<HitPolicy> wrongHPs = Arrays.asList(HitPolicy.UNIQUE, HitPolicy.PRIORITY, HitPolicy.FIRST);
for (HitPolicy hp : wrongHPs) {
List<DMNMessage> validate = getRecommenderHitPolicy3(hp);
assertTrue(validate.stream().anyMatch(m -> m.getMessageType() == DMNMessageType.DECISION_TABLE_HITPOLICY_RECOMMENDER));
}
List<DMNMessage> validate = getRecommenderHitPolicy3(HitPolicy.ANY);
assertTrue(validate.stream().noneMatch(m -> m.getMessageType() == DMNMessageType.DECISION_TABLE_HITPOLICY_RECOMMENDER));
}
Aggregations