Search in sources :

Example 1 with TInvocation

use of org.kie.dmn.model.v1_4.TInvocation in project kie-wb-common by kiegroup.

the class InvocationPropertyConverterTest method testWBFromDMN.

@Test
public void testWBFromDMN() {
    final org.kie.dmn.model.api.Invocation dmn = new TInvocation();
    final org.kie.dmn.model.api.LiteralExpression literalExpression = new TLiteralExpression();
    literalExpression.setId(EXPRESSION_UUID);
    dmn.setId(INVOCATION_UUID);
    dmn.setDescription(INVOCATION_DESCRIPTION);
    dmn.setTypeRef(new QName(INVOCATION_QNAME_LOCALPART));
    dmn.setExpression(literalExpression);
    final Invocation wb = InvocationPropertyConverter.wbFromDMN(dmn, hasComponentWidthsConsumer);
    assertThat(wb).isNotNull();
    assertThat(wb.getId()).isNotNull();
    assertThat(wb.getId().getValue()).isEqualTo(INVOCATION_UUID);
    assertThat(wb.getDescription()).isNotNull();
    assertThat(wb.getDescription().getValue()).isEqualTo(INVOCATION_DESCRIPTION);
    assertThat(wb.getTypeRef()).isNotNull();
    assertThat(wb.getTypeRef().getLocalPart()).isEqualTo(INVOCATION_QNAME_LOCALPART);
    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 : TInvocation(org.kie.dmn.model.v1_2.TInvocation) Invocation(org.kie.workbench.common.dmn.api.definition.model.Invocation) QName(javax.xml.namespace.QName) TInvocation(org.kie.dmn.model.v1_2.TInvocation) TLiteralExpression(org.kie.dmn.model.v1_2.TLiteralExpression) HasComponentWidths(org.kie.workbench.common.dmn.api.definition.HasComponentWidths) Test(org.junit.Test)

Aggregations

QName (javax.xml.namespace.QName)1 Test (org.junit.Test)1 TInvocation (org.kie.dmn.model.v1_2.TInvocation)1 TLiteralExpression (org.kie.dmn.model.v1_2.TLiteralExpression)1 HasComponentWidths (org.kie.workbench.common.dmn.api.definition.HasComponentWidths)1 Invocation (org.kie.workbench.common.dmn.api.definition.model.Invocation)1