use of org.kie.workbench.common.dmn.api.definition.model.UnaryTests in project kie-wb-common by kiegroup.
the class DecisionRuleFactoryTest method testMakeDecisionRule.
@Test
public void testMakeDecisionRule() {
final DecisionRule rule = DecisionRuleFactory.makeDecisionRule(dtable);
final List<UnaryTests> inputEntries = rule.getInputEntry();
assertThat(inputEntries.size()).isEqualTo(2);
assertThat(inputEntries).allSatisfy(unaryTests -> assertUnaryTestsText(unaryTests, DecisionTableDefaultValueUtilities.INPUT_CLAUSE_UNARY_TEST_TEXT)).allSatisfy(unaryTests -> assertThat(unaryTests.getConstraintType()).isEqualTo(NONE)).allSatisfy(unaryTests -> assertThat(unaryTests.getParent()).isEqualTo(rule));
final List<LiteralExpression> outputEntries = rule.getOutputEntry();
assertThat(outputEntries.size()).isEqualTo(2);
assertThat(outputEntries).allSatisfy(literalExpression -> assertLiteralExpressionText(literalExpression, DecisionTableDefaultValueUtilities.OUTPUT_CLAUSE_EXPRESSION_TEXT)).allSatisfy(literalExpression -> assertThat(literalExpression.getParent()).isEqualTo(rule));
final List<RuleAnnotationClauseText> annotationEntries = rule.getAnnotationEntry();
assertThat(annotationEntries.size()).isEqualTo(2);
assertThat(annotationEntries).allSatisfy(clauseText -> assertAnnotationClauseText(clauseText, DecisionTableDefaultValueUtilities.RULE_ANNOTATION_CLAUSE_EXPRESSION_TEXT)).allSatisfy(clauseText -> assertThat(clauseText.getParent()).isEqualTo(rule));
assertThat(rule.getParent()).isEqualTo(dtable);
}
Aggregations