Search in sources :

Example 6 with NodeFactoryImpl

use of org.kie.workbench.common.stunner.core.factory.impl.NodeFactoryImpl in project kie-wb-common by kiegroup.

the class TestingGraphMockHandler method init.

@SuppressWarnings("unchecked")
private TestingGraphMockHandler init() {
    MockitoAnnotations.initMocks(this);
    this.graphFactory = new GraphFactoryImpl(definitionManager);
    this.nodeFactory = new NodeFactoryImpl(definitionUtils);
    this.edgeFactory = new EdgeFactoryImpl(definitionManager);
    this.commandFactory = new GraphCommandFactory();
    this.graph = graphFactory.build(GRAPH_UUID, DEF_SET_ID);
    when(definitionUtils.getDefinitionManager()).thenReturn(definitionManager);
    when(definitionManager.definitionSets()).thenReturn(definitionSetRegistry);
    when(definitionManager.adapters()).thenReturn(adapterManager);
    when(adapterManager.registry()).thenReturn(adapterRegistry);
    when(adapterManager.forDefinition()).thenReturn(definitionAdapter);
    when(adapterManager.forProperty()).thenReturn(propertyAdapter);
    when(adapterManager.forRules()).thenReturn(ruleAdapter);
    when(adapterRegistry.getDefinitionAdapter(any(Class.class))).thenReturn(definitionAdapter);
    when(adapterRegistry.getPropertyAdapter(any(Class.class))).thenReturn(propertyAdapter);
    when(graphCommandExecutionContext.getDefinitionManager()).thenReturn(definitionManager);
    when(graphCommandExecutionContext.getFactoryManager()).thenReturn(factoryManager);
    when(graphCommandExecutionContext.getRuleManager()).thenReturn(ruleManager);
    when(graphCommandExecutionContext.getGraphIndex()).thenReturn(graphIndex);
    when(graphCommandExecutionContext.getRuleSet()).thenReturn(ruleSet);
    when(graphIndex.getGraph()).thenReturn(graph);
    when(ruleManager.evaluate(any(RuleSet.class), any(RuleEvaluationContext.class))).thenReturn(EMPTY_VIOLATIONS);
    return this;
}
Also used : GraphCommandFactory(org.kie.workbench.common.stunner.core.graph.command.impl.GraphCommandFactory) RuleSet(org.kie.workbench.common.stunner.core.rule.RuleSet) NodeFactoryImpl(org.kie.workbench.common.stunner.core.factory.impl.NodeFactoryImpl) EdgeFactoryImpl(org.kie.workbench.common.stunner.core.factory.impl.EdgeFactoryImpl) GraphFactoryImpl(org.kie.workbench.common.stunner.core.factory.impl.GraphFactoryImpl) RuleEvaluationContext(org.kie.workbench.common.stunner.core.rule.RuleEvaluationContext)

Aggregations

EdgeFactoryImpl (org.kie.workbench.common.stunner.core.factory.impl.EdgeFactoryImpl)6 GraphFactoryImpl (org.kie.workbench.common.stunner.core.factory.impl.GraphFactoryImpl)6 NodeFactoryImpl (org.kie.workbench.common.stunner.core.factory.impl.NodeFactoryImpl)6 GraphCommandFactory (org.kie.workbench.common.stunner.core.graph.command.impl.GraphCommandFactory)6 BackendDefinitionAdapter (org.kie.workbench.common.stunner.core.backend.definition.adapter.reflect.BackendDefinitionAdapter)4 BackendDefinitionSetAdapter (org.kie.workbench.common.stunner.core.backend.definition.adapter.reflect.BackendDefinitionSetAdapter)4 GraphCommandManagerImpl (org.kie.workbench.common.stunner.core.graph.command.GraphCommandManagerImpl)4 ArrayList (java.util.ArrayList)3 LinkedList (java.util.LinkedList)3 Before (org.junit.Before)3 TestScopeModelFactory (org.kie.workbench.common.stunner.backend.definition.factory.TestScopeModelFactory)3 BPMNDefinitionSet (org.kie.workbench.common.stunner.bpmn.BPMNDefinitionSet)3 BPMNDiagramMarshaller (org.kie.workbench.common.stunner.bpmn.backend.BPMNDiagramMarshaller)3 BPMNGraphObjectBuilderFactory (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.builder.BPMNGraphObjectBuilderFactory)3 Bpmn2OryxIdMappings (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.Bpmn2OryxIdMappings)3 Bpmn2OryxManager (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.Bpmn2OryxManager)3 AssignmentsTypeSerializer (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.AssignmentsTypeSerializer)3 BooleanTypeSerializer (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.BooleanTypeSerializer)3 Bpmn2OryxPropertyManager (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.Bpmn2OryxPropertyManager)3 Bpmn2OryxPropertySerializer (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.Bpmn2OryxPropertySerializer)3