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;
}
Aggregations