Search in sources :

Example 1 with ParameterGroup

use of org.kie.workbench.common.dmn.client.widgets.decisionservice.parameters.parametergroup.ParameterGroup in project kie-wb-common by kiegroup.

the class DecisionServiceParametersListWidgetTest method testAddDecisionNodeToGroup.

@Test
public void testAddDecisionNodeToGroup() {
    final ParameterGroup group = mock(ParameterGroup.class);
    final Node node = mock(Node.class);
    final Definition definition = mock(Definition.class);
    final Decision decision = mock(Decision.class);
    final InformationItemPrimary variable = mock(InformationItemPrimary.class);
    final String decisionName = "decision name";
    final String type = "type";
    final QName typeRef = mock(QName.class);
    when(definition.getDefinition()).thenReturn(decision);
    when(node.getContent()).thenReturn(definition);
    when(decision.getVariable()).thenReturn(variable);
    when(decision.getName()).thenReturn(new Name(decisionName));
    when(typeRef.getLocalPart()).thenReturn(type);
    when(variable.getTypeRef()).thenReturn(typeRef);
    widget.addDecisionNodeToGroup(group, node);
    verify(group).addParameter(decisionName, type);
}
Also used : InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) ParameterGroup(org.kie.workbench.common.dmn.client.widgets.decisionservice.parameters.parametergroup.ParameterGroup) Node(org.kie.workbench.common.stunner.core.graph.Node) Definition(org.kie.workbench.common.stunner.core.graph.content.definition.Definition) Decision(org.kie.workbench.common.dmn.api.definition.model.Decision) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Decision (org.kie.workbench.common.dmn.api.definition.model.Decision)1 InformationItemPrimary (org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary)1 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)1 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)1 ParameterGroup (org.kie.workbench.common.dmn.client.widgets.decisionservice.parameters.parametergroup.ParameterGroup)1 Node (org.kie.workbench.common.stunner.core.graph.Node)1 Definition (org.kie.workbench.common.stunner.core.graph.content.definition.Definition)1