use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method testGenerateColumnWhenColumnIsNew.
@Test
public void testGenerateColumnWhenColumnIsNew() throws Exception {
final ActionCol52 actionCol52 = mock(ActionCol52.class);
final String header = "header";
doReturn(true).when(plugin).isNewColumn();
doReturn(header).when(editingWrapper).getHeader();
doReturn("factField").when(editingWrapper).getFactField();
doReturn("factType").when(editingWrapper).getFactType();
doReturn(editingWrapper).when(plugin).editingWrapper();
doReturn(actionCol52).when(editingWrapper).getActionCol52();
final Boolean success = plugin.generateColumn();
assertTrue(success);
verify(presenter).appendColumn(actionCol52);
verify(translationService, never()).format(any());
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class ActionWorkItemSetFieldPluginTest method testEditingCol.
@Test
public void testEditingCol() throws Exception {
final ActionCol52 expectedAction = mock(ActionCol52.class);
doReturn(expectedAction).when(editingWrapper).getActionCol52();
final ActionCol52 actualAction = plugin.editingCol();
assertEquals(expectedAction, actualAction);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class BRLActionColumnPluginTest method testGetAlreadyUsedColumnNames.
@Test
public void testGetAlreadyUsedColumnNames() throws Exception {
final GuidedDecisionTable52 model = new GuidedDecisionTable52();
model.getActionCols().add(new ActionCol52() {
{
setHeader("a");
}
});
model.getActionCols().add(new ActionCol52() {
{
setHeader("b");
}
});
when(presenter.getModel()).thenReturn(model);
assertEquals(2, plugin.getAlreadyUsedColumnHeaders().size());
assertTrue(plugin.getAlreadyUsedColumnHeaders().contains("a"));
assertTrue(plugin.getAlreadyUsedColumnHeaders().contains("b"));
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testGetAlreadyUsedColumnNames.
@Test
public void testGetAlreadyUsedColumnNames() throws Exception {
final GuidedDecisionTable52 model = new GuidedDecisionTable52();
model.getActionCols().add(new ActionCol52() {
{
setHeader("a");
}
});
model.getActionCols().add(new ActionCol52() {
{
setHeader("b");
}
});
when(presenter.getModel()).thenReturn(model);
assertEquals(2, plugin.getAlreadyUsedColumnHeaders().size());
assertTrue(plugin.getAlreadyUsedColumnHeaders().contains("a"));
assertTrue(plugin.getAlreadyUsedColumnHeaders().contains("b"));
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class ActionSetFactPluginTest method testGenerateColumnWhenColumnIsNotNew.
@Test
public void testGenerateColumnWhenColumnIsNotNew() throws Exception {
final ActionCol52 editingCol = mock(ActionCol52.class);
final ActionCol52 originalCol = mock(ActionCol52.class);
doReturn(editingCol).when(plugin).editingCol();
doReturn(originalCol).when(plugin).originalCol();
doReturn(false).when(plugin).isNewColumn();
assertTrue(plugin.generateColumn());
verify(presenter).updateColumn(originalCol, editingCol);
}
Aggregations