use of org.kie.dmn.model.v1_4.TBinding in project kie-wb-common by kiegroup.
the class BindingPropertyConverterTest method testWBFromDMN.
@Test
public void testWBFromDMN() {
final org.kie.dmn.model.api.Binding dmn = new TBinding();
final org.kie.dmn.model.api.InformationItem informationItem = new TInformationItem();
dmn.setParameter(informationItem);
final org.kie.dmn.model.api.LiteralExpression literalExpression = new TLiteralExpression();
literalExpression.setId(EXPRESSION_UUID);
dmn.setExpression(literalExpression);
final Binding wb = BindingPropertyConverter.wbFromDMN(dmn, hasComponentWidthsConsumer);
assertThat(wb).isNotNull();
assertThat(wb.getParameter()).isNotNull();
assertThat(wb.getExpression()).isNotNull();
assertThat(wb.getExpression().getId().getValue()).isEqualTo(EXPRESSION_UUID);
verify(hasComponentWidthsConsumer).accept(eq(EXPRESSION_UUID), hasComponentWidthsCaptor.capture());
final HasComponentWidths hasComponentWidths = hasComponentWidthsCaptor.getValue();
assertThat(hasComponentWidths).isNotNull();
assertThat(hasComponentWidths).isEqualTo(wb.getExpression());
}
Aggregations