Search in sources :

Example 66 with CustomTask

use of org.kie.workbench.common.stunner.bpmn.workitem.CustomTask in project kie-wb-common by kiegroup.

the class CaseGraphFactoryImplTest method setUp.

@Before
public void setUp() throws Exception {
    milestone = new CustomTask();
    graphCommandFactory = new GraphCommandFactory();
    when(customTaskFactory.buildItem(MILESTONE)).thenReturn(milestone);
    when(definitionManager.adapters()).thenReturn(adapters);
    when(adapters.registry()).thenReturn(registry);
    when(registry.getDefinitionAdapter(CustomTask.class)).thenReturn(adapter);
    when(adapter.getId(milestone)).thenReturn(DefinitionId.build(MILESTONE_ID));
    when(factoryManager.newElement(anyString(), eq(getDefinitionId(BPMNDiagramImpl.class)))).thenReturn(diagramNode);
    when(factoryManager.newElement(anyString(), eq(MILESTONE_ID))).thenReturn(milestoneNode);
    when(diagramNode.getContent()).thenReturn(diagramContent);
    when(diagramContent.getDefinition()).thenReturn(diagramDefinition);
    when(diagramDefinition.getDiagramSet()).thenReturn(diagramSet);
    when(diagramSet.getAdHoc()).thenReturn(adHoc);
    when(adapters.forProperty()).thenReturn(propertyAdapter);
    when(propertyAdapter.getId(adHoc)).thenReturn(ADHOC_ID);
    when(diagramNode.getUUID()).thenReturn(UUID.uuid());
    Index index = mock(Index.class);
    when(indexBuilder.build(any(Graph.class))).thenReturn(index);
    tested = new CaseGraphFactoryImpl(definitionManager, factoryManager, ruleManager, graphCommandManager, graphCommandFactory, indexBuilder, customTaskFactory, workItemDefinitionService);
}
Also used : GraphCommandFactory(org.kie.workbench.common.stunner.core.graph.command.impl.GraphCommandFactory) Graph(org.kie.workbench.common.stunner.core.graph.Graph) Index(org.kie.workbench.common.stunner.core.graph.processing.index.Index) CustomTask(org.kie.workbench.common.stunner.bpmn.workitem.CustomTask) Before(org.junit.Before)

Aggregations

CustomTask (org.kie.workbench.common.stunner.bpmn.workitem.CustomTask)66 Test (org.junit.Test)58 Ignore (org.junit.Ignore)18 View (org.kie.workbench.common.stunner.core.graph.content.view.View)5 Before (org.junit.Before)4 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)3 TaskGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)3 Graph (org.kie.workbench.common.stunner.core.graph.Graph)3 Collections (java.util.Collections)2 Consumer (java.util.function.Consumer)2 Function (java.util.function.Function)2 GenericServiceTaskPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.GenericServiceTaskPropertyReader)2 ServiceTaskPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ServiceTaskPropertyReader)2 Lane (org.kie.workbench.common.stunner.bpmn.definition.Lane)2 NoneTask (org.kie.workbench.common.stunner.bpmn.definition.NoneTask)2 SequenceFlow (org.kie.workbench.common.stunner.bpmn.definition.SequenceFlow)2 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)2 CustomTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.workitem.CustomTaskExecutionSet)2 WorkItemDefinition (org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinition)2 WorkItemDefinitionRegistry (org.kie.workbench.common.stunner.bpmn.workitem.WorkItemDefinitionRegistry)2