@Test public void fixAddsAVersionOfRelation() { String vertex1CreatedProp = changeStringWithTimestamp(1500L); GraphWrapper graphWrapper = newGraph().withVertex("v1", v -> v.withTimId("id1") .withProperty("rev", 2) .withProperty("modified", changeStringWithTimestamp(10000L)) .withProperty("created", vertex1CreatedProp) .withProperty("isLatest", true)) .wrap(); DatabaseFixer instance = new DatabaseFixer(graphWrapper); instance.fix(); Optional<Vertex> vertex = graphWrapper.getGraph().traversal().V().has("tim_id", "id1").has("rev", 1).tryNext(); assertThat(vertex, is(present())); Iterator<Edge> versionOfRelations = vertex.get().edges(Direction.OUT, "VERSION_OF"); assertThat(versionOfRelations.hasNext(), is(true)); }
public void fix() { Graph graph = graphWrapper .getGraph(); fixEdges(graph); fixVertices(graph); }
DatabaseFixer { public void fix() { Graph graph = graphWrapper .getGraph(); fixEdges(graph); fixVertices(graph); } }
DatabaseFixer { public void fix() { Graph graph = graphWrapper .getGraph(); fixEdges(graph); fixVertices(graph); } DatabaseFixer(GraphWrapper graphWrapper); }
DatabaseFixer { public void fix() { Graph graph = graphWrapper .getGraph(); fixEdges(graph); fixVertices(graph); } DatabaseFixer(GraphWrapper graphWrapper); void fix(); Optional<Edge> getPreviousVersion(Edge edge); }
DatabaseFixer { public void fix() { Graph graph = graphWrapper .getGraph(); fixEdges(graph); fixVertices(graph); } DatabaseFixer(GraphWrapper graphWrapper); void fix(); Optional<Edge> getPreviousVersion(Edge edge);  }