use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 in project drools-wb by kiegroup.
the class ActionWorkItemPluginTest method testForEachWorkItemWhenOneHasBeenExecutedNewColumn.
@Test
public void testForEachWorkItemWhenOneHasBeenExecutedNewColumn() {
final PortableWorkDefinition workItem1 = getMock("workItem1");
final PortableWorkDefinition workItem2 = getMock("workItem2");
final HashMap<String, String> actualWorkItems = new HashMap<>();
final HashMap<String, String> expectedWorkItems = new HashMap<String, String>() {
{
put("workItem2", "workItem2");
}
};
final HashSet<PortableWorkDefinition> fakeDefinitions = new HashSet<PortableWorkDefinition>() {
{
add(workItem1);
add(workItem2);
}
};
when(presenter.getWorkItemDefinitions()).thenReturn(fakeDefinitions);
when(presenter.getModel()).thenReturn(model);
when(model.getActionCols()).thenReturn(Collections.singletonList(new ActionWorkItemCol52() {
{
setWorkItemDefinition(workItem1);
}
}));
when(plugin.isNewColumn()).thenReturn(true);
plugin.forEachWorkItem(actualWorkItems::put);
assertEquals(expectedWorkItems, actualWorkItems);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 in project drools-wb by kiegroup.
the class ActionWorkItemPluginTest method testGetHeader.
@Test
public void testGetHeader() {
final ActionWorkItemCol52 actionCol52 = mock(ActionWorkItemCol52.class);
doReturn(actionCol52).when(plugin).editingCol();
plugin.getHeader();
verify(actionCol52).getHeader();
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 in project drools-wb by kiegroup.
the class ActionWorkItemPluginTest method testForEachWorkItemWhenOneHasBeenExecutedUpdatedColumn.
@Test
public void testForEachWorkItemWhenOneHasBeenExecutedUpdatedColumn() {
final PortableWorkDefinition workItem1 = getMock("workItem1");
final PortableWorkDefinition workItem2 = getMock("workItem2");
final HashMap<String, String> actualWorkItems = new HashMap<>();
final HashMap<String, String> expectedWorkItems = new HashMap<String, String>() {
{
put("workItem1", "workItem1");
put("workItem2", "workItem2");
}
};
final HashSet<PortableWorkDefinition> fakeDefinitions = new HashSet<PortableWorkDefinition>() {
{
add(workItem1);
add(workItem2);
}
};
when(presenter.getWorkItemDefinitions()).thenReturn(fakeDefinitions);
when(presenter.getModel()).thenReturn(model);
when(model.getActionCols()).thenReturn(Collections.singletonList(new ActionWorkItemCol52() {
{
setWorkItemDefinition(workItem1);
}
}));
when(plugin.isNewColumn()).thenReturn(false);
when(plugin.getWorkItemDefinition()).thenReturn(workItem1);
plugin.forEachWorkItem(actualWorkItems::put);
assertEquals(expectedWorkItems, actualWorkItems);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 in project drools-wb by kiegroup.
the class ActionWorkItemPluginTest method testIsHideColumn.
@Test
public void testIsHideColumn() {
final ActionWorkItemCol52 actionCol52 = mock(ActionWorkItemCol52.class);
doReturn(actionCol52).when(plugin).editingCol();
plugin.isHideColumn();
verify(actionCol52).isHideColumn();
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52 in project drools-wb by kiegroup.
the class ActionWorkItemPluginTest method testGenerateColumnWhenColumnIsNotNew.
@Test
public void testGenerateColumnWhenColumnIsNotNew() throws Exception {
final ActionWorkItemCol52 column = mock(ActionWorkItemCol52.class);
doReturn(false).when(plugin).isNewColumn();
doReturn(column).when(plugin).getOriginalColumnConfig52();
plugin.generateColumn();
verify(presenter).updateColumn(column, editingCol);
}
Aggregations