use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.
the class GuidedDecisionTableModellerPresenterTest method makeDecisionTableContent.
private GuidedDecisionTableEditorContent makeDecisionTableContent() {
final GuidedDecisionTable52 model = mock(GuidedDecisionTable52.class);
final PackageDataModelOracleBaselinePayload dmoBaseline = mock(PackageDataModelOracleBaselinePayload.class);
final Set<PortableWorkDefinition> workItemDefinitions = Collections.emptySet();
final Overview overview = mock(Overview.class);
final GuidedDecisionTableEditorContent dtContent = new GuidedDecisionTableEditorContent(model, workItemDefinitions, overview, dmoBaseline);
return dtContent;
}
use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenter_AuditLogTest method setupPresenter.
private void setupPresenter() {
dtPresenter = new GuidedDecisionTablePresenter(identity, null, null, null, null, null, refreshAttributesPanelEvent, refreshMetaDataPanelEvent, refreshConditionsPanelEvent, refreshActionsPanelEvent, refreshMenusEvent, null, null, gridWidgetColumnFactory, oracleFactory, synchronizer, beanManager, lockManager, null, null, decisionTableAnalyzerProvider, enumLoaderUtilities, pluginHandler, authorizationManager, sessionInfo) {
@Override
void initialiseLockManager() {
// Do nothing for tests
}
@Override
GuidedDecisionTableView makeView(final Set<PortableWorkDefinition> workItemDefinitions) {
return view;
}
@Override
void initialiseModels() {
// Do nothing for tests
}
};
final AsyncPackageDataModelOracle dmo = mock(AsyncPackageDataModelOracle.class);
final PackageDataModelOracleBaselinePayload dmoBaseline = mock(PackageDataModelOracleBaselinePayload.class);
final Set<PortableWorkDefinition> workItemDefinitions = Collections.emptySet();
final Overview overview = mock(Overview.class);
dtContent = new GuidedDecisionTableEditorContent(model, workItemDefinitions, overview, dmoBaseline);
when(oracleFactory.makeAsyncPackageDataModelOracle(any(Path.class), any(GuidedDecisionTable52.class), eq(dmoBaseline))).thenReturn(dmo);
dtPresenter.setContent(null, mock(PlaceRequest.class), dtContent, modellerPresenter, false);
when(view.getLayer()).thenReturn(mock(Layer.class));
}
use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.
the class ActionWorkItemExecuteColumnConverterTest method getColumn.
@Override
protected BaseColumn getColumn() {
final ActionWorkItemCol52 column = new ActionWorkItemCol52();
final PortableWorkDefinition pwd = new PortableWorkDefinition();
pwd.setName(WID_NAME);
column.setWorkItemDefinition(pwd);
column.setHeader(HEADER);
column.setWidth(WIDTH);
return column;
}
use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.
the class WorkItemPageTest method testShowParametersWhenItHasWorkItemDefinitionParametersAreEnabled.
@Test
public void testShowParametersWhenItHasWorkItemDefinitionParametersAreEnabled() {
final PortableWorkDefinition workDefinition = mock(PortableWorkDefinition.class);
when(plugin.getWorkItemDefinition()).thenReturn(workDefinition);
page.enableParameters();
page.showParameters();
verify(view).showParameters(any());
}
use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition 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);
}
Aggregations