use of org.kie.workbench.common.stunner.core.backend.StunnerTestingGraphBackendAPI in project kie-wb-common by kiegroup.
the class GraphBuilderTest method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
when(diagram.getPlane()).thenReturn(plane);
List<RootElement> rootElements = Collections.singletonList(process);
List<BPMNDiagram> diagrams = Collections.singletonList(diagram);
when(definitions.getId()).thenReturn(DIAGRAM_UUID);
when(definitions.getRootElements()).thenReturn(rootElements);
when(definitions.getDiagrams()).thenReturn(diagrams);
when(definitions.getRelationships()).thenReturn(Collections.emptyList());
definitionResolver = new DefinitionResolver(definitions, Collections.emptyList());
StunnerTestingGraphBackendAPI api = StunnerTestingGraphBackendAPI.build(BPMNDefinitionSet.class, new BPMNTestDefinitionFactory());
TypedFactoryManager typedFactoryManager = new TypedFactoryManager(api.getFactoryManager());
Metadata metadata = new MetadataImpl.MetadataImplBuilder(BindableAdapterUtils.getDefinitionSetId(BPMNDefinitionSet.class)).build();
Diagram<Graph<DefinitionSet, Node>, Metadata> diagram = api.getFactoryManager().newDiagram(definitionResolver.getDefinitions().getId(), BPMN_ID, metadata);
graph = diagram.getGraph();
graphBuilder = new GraphBuilder(graph, api.getDefinitionManager(), typedFactoryManager, api.getRuleManager(), api.commandFactory, api.commandManager);
}
use of org.kie.workbench.common.stunner.core.backend.StunnerTestingGraphBackendAPI in project kie-wb-common by kiegroup.
the class ProcessConverterDelegateTest method setUp.
@Before
public void setUp() throws Exception {
parentNode = new BpmnNode.Simple(new NodeImpl<>("ParentNode"), basePropertyReader);
when(diagram.getPlane()).thenReturn(plane);
List<RootElement> rootElements = Collections.singletonList(process);
List<BPMNDiagram> diagrams = Collections.singletonList(diagram);
when(definitions.getRootElements()).thenReturn(rootElements);
when(definitions.getDiagrams()).thenReturn(diagrams);
when(definitions.getRelationships()).thenReturn(Collections.emptyList());
when(plane.getPlaneElement()).thenReturn(new ArrayList<>());
definitionResolver = new DefinitionResolver(definitions, Collections.emptyList());
StunnerTestingGraphBackendAPI api = StunnerTestingGraphBackendAPI.build(BPMNDefinitionSet.class, new BPMNTestDefinitionFactory());
TypedFactoryManager typedFactoryManager = new TypedFactoryManager(api.getFactoryManager());
factory = new ConverterFactory(definitionResolver, typedFactoryManager);
converterDelegate = new ProcessConverterDelegate(typedFactoryManager, propertyReaderFactory, definitionResolver, factory);
}
Aggregations