use of org.kie.workbench.common.dmn.api.definition.model.Relation in project kie-wb-common by kiegroup.
the class RelationEditorDefinitionTest method testModelEnrichment.
@Test
public void testModelEnrichment() {
final Optional<Relation> oModel = definition.getModelClass();
definition.enrich(Optional.empty(), hasExpression, oModel);
final Relation model = oModel.get();
assertNotNull(model.getRow());
assertNotNull(model.getRow().get(0).getId());
assertNotNull(model.getRow().get(0).getExpression().get(0));
assertTrue(model.getRow().get(0).getExpression().get(0).getExpression() instanceof LiteralExpression);
assertNotNull(model.getColumn());
assertEquals(1, model.getColumn().size());
assertEquals(RelationDefaultValueUtilities.PREFIX + "1", model.getColumn().get(0).getName().getValue());
assertEquals(model, model.getRow().get(0).getParent());
assertEquals(model, model.getColumn().get(0).getParent());
assertEquals(model.getRow().get(0), model.getRow().get(0).getExpression().get(0).getExpression().getParent());
}
Aggregations