use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionInsertFactWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testSetFactFieldWhenColumnIsNotNew.
@Test
public void testSetFactFieldWhenColumnIsNotNew() {
final ActionInsertFactWrapper actionWrapper = mock(ActionInsertFactWrapper.class);
final PatternWrapper patternWrapperMock = patternWrapperMock("factType", "boundName");
doReturn(false).when(plugin).isNewColumn();
doReturn(true).when(plugin).isNewFactPattern();
doReturn(actionWrapper).when(plugin).editingWrapper();
doReturn(patternWrapperMock).when(plugin).patternWrapper();
doReturn("type").when(oracle).getFieldType(any(), any());
plugin.setFactField("selectedValue");
verify(actionWrapper).setFactField(eq("selectedValue"));
verify(actionWrapper).setFactType(eq("factType"));
verify(actionWrapper).setBoundName(eq("boundName"));
verify(actionWrapper).setType(eq("type"));
verify(plugin).fireChangeEvent(fieldPage);
verify(plugin, never()).newActionInsertFactWrapper();
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionInsertFactWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testSetFactFieldWhenFactPatternIsNew.
@Test
public void testSetFactFieldWhenFactPatternIsNew() {
final ActionInsertFactWrapper actionWrapper = mock(ActionInsertFactWrapper.class);
final PatternWrapper patternWrapperMock = patternWrapperMock("factType", "boundName");
doReturn(true).when(plugin).isNewFactPattern();
doReturn(actionWrapper).when(plugin).newActionInsertFactWrapper();
doReturn(patternWrapperMock).when(plugin).patternWrapper();
doReturn("type").when(oracle).getFieldType(any(), any());
plugin.setFactField("selectedValue");
verify(actionWrapper).setFactField(eq("selectedValue"));
verify(actionWrapper).setFactType(eq("factType"));
verify(actionWrapper).setBoundName(eq("boundName"));
verify(actionWrapper).setType(eq("type"));
verify(plugin).fireChangeEvent(fieldPage);
}
use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionInsertFactWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testNewActionWrapperWhenColumnIsAnActionInsertFactCol52.
@Test
public void testNewActionWrapperWhenColumnIsAnActionInsertFactCol52() throws Exception {
final GuidedDecisionTable52 model = mock(GuidedDecisionTable52.class);
when(model.getTableFormat()).thenReturn(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY);
when(presenter.getModel()).thenReturn(model);
final ActionWrapper wrapper = plugin.newActionWrapper(mock(ActionInsertFactCol52.class));
assertTrue(wrapper instanceof ActionInsertFactWrapper);
}
Aggregations