use of org.kie.workbench.common.dmn.api.definition.model.DecisionTable in project kie-wb-common by kiegroup.
the class DecisionTableEditorDefinitionEnricherTest method testModelEnrichmentWhenTopLevelDecisionTableWithDecisionAndInputData.
@Test
@SuppressWarnings("unchecked")
public void testModelEnrichmentWhenTopLevelDecisionTableWithDecisionAndInputData() {
setupGraphWithDiagram();
setupGraphWithDecision();
setupGraphWithInputData();
final Optional<DecisionTable> oModel = definition.getModelClass();
definition.enrich(Optional.of(NODE_UUID), decision, oModel);
final DecisionTable model = oModel.get();
assertBasicEnrichment(model);
final List<InputClause> input = model.getInput();
assertThat(input.size()).isEqualTo(3);
assertThat(input.get(0).getInputExpression()).isInstanceOf(InputClauseLiteralExpression.class);
assertThat(input.get(0).getInputExpression().getText().getValue()).isEqualTo(INPUT_DATA_NAME_2);
assertThat(input.get(0).getInputExpression().getTypeRef()).isEqualTo(INPUT_DATA_QNAME_2);
assertThat(input.get(1).getInputExpression()).isInstanceOf(InputClauseLiteralExpression.class);
assertThat(input.get(1).getInputExpression().getText().getValue()).isEqualTo(DECISION_NAME_1);
assertThat(input.get(1).getInputExpression().getTypeRef()).isEqualTo(DECISION_QNAME_1);
assertThat(input.get(2).getInputExpression()).isInstanceOf(InputClauseLiteralExpression.class);
assertThat(input.get(2).getInputExpression().getText().getValue()).isEqualTo(INPUT_DATA_NAME_1);
assertThat(input.get(2).getInputExpression().getTypeRef()).isEqualTo(INPUT_DATA_QNAME_1);
assertStandardOutputClauseEnrichment(model);
assertStandardDecisionRuleEnrichment(model);
assertParentHierarchyEnrichment(model);
}
Aggregations