Search in sources :

Example 1 with TBinding

use of org.kie.dmn.model.v1_2.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());
}
Also used : Binding(org.kie.workbench.common.dmn.api.definition.model.Binding) TBinding(org.kie.dmn.model.v1_2.TBinding) TBinding(org.kie.dmn.model.v1_2.TBinding) TInformationItem(org.kie.dmn.model.v1_2.TInformationItem) TLiteralExpression(org.kie.dmn.model.v1_2.TLiteralExpression) HasComponentWidths(org.kie.workbench.common.dmn.api.definition.HasComponentWidths) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 TBinding (org.kie.dmn.model.v1_2.TBinding)1 TInformationItem (org.kie.dmn.model.v1_2.TInformationItem)1 TLiteralExpression (org.kie.dmn.model.v1_2.TLiteralExpression)1 HasComponentWidths (org.kie.workbench.common.dmn.api.definition.HasComponentWidths)1 Binding (org.kie.workbench.common.dmn.api.definition.model.Binding)1