use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method mockPatternWrapper.
private PatternWrapper mockPatternWrapper(final String boundName) {
final PatternWrapper wrapper = mock(PatternWrapper.class);
when(wrapper.getBoundName()).thenReturn(boundName);
return wrapper;
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper 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.PatternWrapper in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method testSetEditingPattern.
@Test
public void testSetEditingPattern() throws Exception {
final PatternWrapper patternWrapper = mock(PatternWrapper.class);
plugin.setEditingPattern(patternWrapper);
verify(editingWrapper).setFactField(null);
verify(editingWrapper).setFactType(null);
verify(editingWrapper).setBoundName(null);
verify(editingWrapper).setType(null);
verify(plugin).fireChangeEvent(patternPage);
verify(plugin).fireChangeEvent(fieldPage);
verify(plugin).fireChangeEvent(additionalInfoPage);
assertEquals(patternWrapper, plugin.patternWrapper());
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method testIsNewFactPatternWhenIsExisting.
@Test
public void testIsNewFactPatternWhenIsExisting() throws Exception {
mockPatterns();
plugin.setEditingPattern(new PatternWrapper("factType", "boundName"));
assertFalse(plugin.isNewFactPattern());
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.PatternWrapper in project drools-wb by kiegroup.
the class ConditionColumnPluginTest method testGetEditingPattern.
@Test
public void testGetEditingPattern() throws Exception {
final PatternWrapper patternWrapper = mock(PatternWrapper.class);
final InOrder inOrder = inOrder(plugin);
plugin.setEditingPattern(patternWrapper);
inOrder.verify(plugin).setupDefaultValues();
inOrder.verify(plugin).setPatternWrapper(patternWrapper);
verify(plugin).setupDefaultValues();
verify(plugin).fireChangeEvent(patternPage);
verify(plugin).fireChangeEvent(calculationTypePage);
verify(plugin).fireChangeEvent(fieldPage);
verify(plugin).fireChangeEvent(operatorPage);
verify(plugin).fireChangeEvent(valueOptionsPage);
verify(plugin).fireChangeEvent(additionalInfoPage);
}
Aggregations