@Test public void testRemoveVertex() { Person marko = createElement(); vertexGraph.removeVertex(marko); InOrder inOrder = inOrder(g, traversal); inOrder.verify(g, times(1)).V(); inOrder.verify(traversal, times(1)).hasLabel(marko.label()); inOrder.verify(traversal, times(1)).has("name", marko.name()); inOrder.verify(traversal, times(1)).drop(); inOrder.verify(traversal, times(1)).toList(); }
public <V extends Vertex> Vertex removeVertex(V vertex) { GraphTraversal traversal = find(vertex); log.info("Executing 'remove vertex' traversal {} ", traversal); traversal.drop().toList(); if (vertex.id() != null) { delegates.remove(vertex); } observers.notifyAll(observer -> observer.vertexRemoved(vertex)); return vertex; }
VertexGraph extends ElementGraph { public <V extends Vertex> Vertex removeVertex(V vertex) { GraphTraversal traversal = find(vertex); log.info("Executing 'remove vertex' traversal {} ", traversal); traversal.drop().toList(); if (vertex.id() != null) { delegates.remove(vertex); } observers.notifyAll(observer -> observer.vertexRemoved(vertex)); return vertex; } }
VertexGraph extends ElementGraph { public <V extends Vertex> Vertex removeVertex(V vertex) { GraphTraversal traversal = find(vertex); log.info("Executing 'remove vertex' traversal {} ", traversal); traversal.drop().toList(); if (vertex.id() != null) { delegates.remove(vertex); } observers.notifyAll(observer -> observer.vertexRemoved(vertex)); return vertex; } VertexGraph(Graph graph, GraphTraversalSource g); }
VertexGraph extends ElementGraph { public <V extends Vertex> Vertex removeVertex(V vertex) { GraphTraversal traversal = find(vertex); log.info("Executing 'remove vertex' traversal {} ", traversal); traversal.drop().toList(); if (vertex.id() != null) { delegates.remove(vertex); } observers.notifyAll(observer -> observer.vertexRemoved(vertex)); return vertex; } VertexGraph(Graph graph, GraphTraversalSource g); org.apache.tinkerpop.gremlin.structure.Vertex delegate(V vertex); Vertex addVertex(V vertex); Vertex removeVertex(V vertex); void reset(); }
VertexGraph extends ElementGraph { public <V extends Vertex> Vertex removeVertex(V vertex) { GraphTraversal traversal = find(vertex); log.info("Executing 'remove vertex' traversal {} ", traversal); traversal.drop().toList(); if (vertex.id() != null) { delegates.remove(vertex); } observers.notifyAll(observer -> observer.vertexRemoved(vertex)); return vertex; } VertexGraph(Graph graph, GraphTraversalSource g); org.apache.tinkerpop.gremlin.structure.Vertex delegate(V vertex); Vertex addVertex(V vertex); Vertex removeVertex(V vertex); void reset();  }