use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.ActionSetFactWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testSetFactFieldWhenFactPatternIsNotNew.
@Test
public void testSetFactFieldWhenFactPatternIsNotNew() {
final ActionSetFactWrapper actionWrapper = spy(new ActionSetFactWrapper(plugin));
final Pattern52 patternMock = patternMock("factType");
final PatternWrapper patternWrapperMock = patternWrapperMock("factType", "boundName");
doReturn(false).when(plugin).isNewFactPattern();
doReturn(actionWrapper).when(plugin).newActionSetFactWrapper();
doReturn(patternWrapperMock).when(plugin).patternWrapper();
doReturn(patternMock).when(model).getConditionPattern(eq("boundName"));
doReturn("type").when(oracle).getFieldType(eq("factType"), eq("selectedValue"));
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.ActionSetFactWrapper in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testNewActionWrapperWhenColumnIsAnActionSetFactWrapper.
@Test
public void testNewActionWrapperWhenColumnIsAnActionSetFactWrapper() 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(ActionSetFieldCol52.class));
assertTrue(wrapper instanceof ActionSetFactWrapper);
}
Aggregations