use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWorkItemWrapper in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method testSetupValuesWhenColumnIsNotNew.
@Test
public void testSetupValuesWhenColumnIsNotNew() throws Exception {
final DTColumnConfig52 column = mock(DTColumnConfig52.class);
final ActionWorkItemWrapper actionWrapper = mock(ActionWorkItemWrapper.class);
final PatternWrapper patternWrapper = mock(PatternWrapper.class);
doReturn(model).when(presenter).getModel();
doReturn(column).when(plugin).getOriginalColumnConfig52();
doReturn(actionWrapper).when(plugin).newActionWorkItemWrapper(column);
doReturn(patternWrapper).when(plugin).newPatternWrapper(actionWrapper);
doReturn("WorkItemName").when(actionWrapper).getWorkItemName();
doReturn("WorkItemResultParameterName").when(actionWrapper).getWorkItemResultParameterName();
doReturn(new ArrayList<ActionCol52>()).when(model).getActionCols();
doReturn(false).when(plugin).isNewColumn();
plugin.setupValues();
verify(plugin).setupWorkItems();
verify(plugin).setWorkItem("WorkItemName:WorkItemResultParameterName");
verify(plugin).setWorkItemPageAsCompleted();
verify(plugin).fireChangeEvent(patternPage);
verify(plugin).fireChangeEvent(fieldPage);
verify(plugin).fireChangeEvent(additionalInfoPage);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWorkItemWrapper in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method testNewActionWrapperWhenColumnIsAnActionSetFactWrapper.
@Test
public void testNewActionWrapperWhenColumnIsAnActionSetFactWrapper() throws Exception {
when(model.getTableFormat()).thenReturn(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY);
when(presenter.getModel()).thenReturn(model);
final ActionWorkItemWrapper wrapper = plugin.newActionWorkItemWrapper(mock(ActionWorkItemSetFieldCol52.class));
assertTrue(wrapper instanceof ActionWorkItemSetWrapper);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWorkItemWrapper in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method testNewActionWrapperWhenColumnIsAnActionWorkItemInsertFactCol52.
@Test
public void testNewActionWrapperWhenColumnIsAnActionWorkItemInsertFactCol52() throws Exception {
when(model.getTableFormat()).thenReturn(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY);
when(presenter.getModel()).thenReturn(model);
final ActionWorkItemWrapper wrapper = plugin.newActionWorkItemWrapper(mock(ActionWorkItemInsertFactCol52.class));
assertTrue(wrapper instanceof ActionWorkItemInsertWrapper);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWorkItemWrapper in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method testNewPatternWrapperWhenPatternIsNotFound.
@Test
public void testNewPatternWrapperWhenPatternIsNotFound() throws Exception {
final Set<PatternWrapper> actionWrappers = new HashSet<>();
final ActionWorkItemWrapper actionWrapper = mockActionWrapper("BoundName", "FactType");
doReturn(actionWrappers).when(plugin).getPatterns();
final PatternWrapper patternWrapper = plugin.newPatternWrapper(actionWrapper);
assertEquals(actionWrapper.getBoundName(), patternWrapper.getBoundName());
assertEquals(actionWrapper.getFactType(), patternWrapper.getFactType());
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionWorkItemWrapper in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method mockActionWrapper.
private ActionWorkItemWrapper mockActionWrapper(final String boundName, final String factType) {
final ActionWorkItemWrapper wrapper = mock(ActionWorkItemWrapper.class);
when(wrapper.getBoundName()).thenReturn(boundName);
when(wrapper.getFactType()).thenReturn(factType);
return wrapper;
}
Aggregations