use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.
the class EdgeBuilderImplTest method testDoBuildReturnNull.
@Test
public void testDoBuildReturnNull() {
when(context.getIndex().getEdge(EDGE_ID)).thenReturn(edge);
edgeBuilder.nodeId(EDGE_ID);
Element edge1 = edgeBuilder.build(context);
Assert.assertEquals(edge1, null);
}
use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.
the class NodeBuilderImplTest method testDoBuildNewNode.
@Test
public void testDoBuildNewNode() {
when(context.getIndex().getNode(NODE_ID)).thenReturn(null);
when(context.getOryxManager()).thenReturn(oryxManager);
when(context.getOryxManager().getMappingsManager()).thenReturn(oryxIdMappings);
when(context.getOryxManager().getMappingsManager().getDefinitionId(any(Class.class))).thenReturn(DEFINITION_ID);
when(factoryManager.newElement(null, DEFINITION_ID)).thenReturn(node);
when(node.getContent()).thenReturn(view);
when(view.getDefinition()).thenReturn(definition);
when(context.getDefinitionManager()).thenReturn(definitionManager);
when(context.getDefinitionManager().adapters()).thenReturn(adapters);
when(context.getDefinitionManager().adapters().forDefinition()).thenReturn(forDefinition);
when(context.getDefinitionManager().adapters().forDefinition().getProperties(definition)).thenReturn(set);
when(context.execute(any())).thenReturn(res);
when(context.getCommandFactory()).thenReturn(graphCommandFactory);
Element node1 = nodeBuilder.build(context);
Assert.assertEquals(node1, node);
}
use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.
the class NodeBuilderImplTest method testDoBuildExistingNode.
@Test
public void testDoBuildExistingNode() {
when(context.getIndex().getNode(NODE_ID)).thenReturn(node);
nodeBuilder.nodeId(NODE_ID);
Element node1 = nodeBuilder.build(context);
Assert.assertEquals(node1, node);
}
use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.
the class StartEventFilterProvider method provideFilters.
@Override
public Collection<FormElementFilter> provideFilters(String elementUUID, Element<? extends Definition<?>> element, Object definition) {
Predicate predicate = o -> isParentAnEventSubProcess(elementUUID);
FormElementFilter isInterruptingFilter = new FormElementFilter("executionSet.isInterrupting", predicate);
return Arrays.asList(isInterruptingFilter);
}
use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.
the class AbstractProcessFilteredNodeProviderBaseTest method testGetSelectorDataWithValues.
@Test
public void testGetSelectorDataWithValues() {
List<Element> nodes = mockModes();
when(graph.nodes()).thenReturn(nodes);
SelectorData selectorData = provider.getSelectorData(renderingContext);
Map values = selectorData.getValues();
assertEquals(nodes.size(), values.size());
verifyValues(values);
}
Aggregations