Search in sources :

Example 1 with InvocationUIModelMapper

use of org.kie.workbench.common.dmn.client.editors.expressions.types.invocation.InvocationUIModelMapper in project kie-wb-common by kiegroup.

the class AddParameterBindingCommandTest method setup.

@Before
@SuppressWarnings("unchecked")
public void setup() {
    this.invocation = new Invocation();
    this.binding = new Binding();
    final InformationItem parameter = new InformationItem();
    parameter.setName(new Name("p" + invocation.getBinding().size()));
    this.binding.setParameter(parameter);
    this.uiModel = new BaseGridData(false);
    this.uiModelRow = new DMNGridRow();
    this.uiModel.appendColumn(uiRowNumberColumn);
    this.uiModel.appendColumn(uiNameColumn);
    this.uiModel.appendColumn(uiExpressionEditorColumn);
    this.uiModelMapper = new InvocationUIModelMapper(gridWidget, () -> uiModel, () -> Optional.of(invocation), () -> expressionEditorDefinitions, listSelector, 0);
    doReturn(ruleManager).when(handler).getRuleManager();
    doReturn(0).when(uiRowNumberColumn).getIndex();
    doReturn(1).when(uiNameColumn).getIndex();
    doReturn(2).when(uiExpressionEditorColumn).getIndex();
    doReturn(uiModel).when(gridWidget).getModel();
    doReturn(Optional.empty()).when(expressionEditorDefinitions).getExpressionEditorDefinition(any(Optional.class));
}
Also used : Binding(org.kie.workbench.common.dmn.api.definition.v1_1.Binding) DMNGridRow(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow) Invocation(org.kie.workbench.common.dmn.api.definition.v1_1.Invocation) Optional(java.util.Optional) InformationItem(org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) InvocationUIModelMapper(org.kie.workbench.common.dmn.client.editors.expressions.types.invocation.InvocationUIModelMapper) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) Before(org.junit.Before)

Aggregations

Optional (java.util.Optional)1 Before (org.junit.Before)1 Binding (org.kie.workbench.common.dmn.api.definition.v1_1.Binding)1 InformationItem (org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem)1 Invocation (org.kie.workbench.common.dmn.api.definition.v1_1.Invocation)1 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)1 InvocationUIModelMapper (org.kie.workbench.common.dmn.client.editors.expressions.types.invocation.InvocationUIModelMapper)1 DMNGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow)1 BaseGridData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData)1