use of org.kie.dmn.model.v1_1.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());
}
Aggregations