@Test public void fixAddsMissingVertices() { String vertex1CreatedProp = changeStringWithTimestamp(1500L); String vertex2CreatedProp = changeStringWithTimestamp(1400L); GraphWrapper graphWrapper = newGraph().withVertex("v1", v -> v.withTimId("id1") .withProperty("rev", 2) .withProperty("modified", changeStringWithTimestamp(10000L)) .withProperty("created", vertex1CreatedProp) .withProperty("isLatest", true)) .withVertex("v2", v -> v.withTimId("id2").withProperty("rev", 3) .withProperty("modified", changeStringWithTimestamp(10000L)) .withProperty("created", vertex2CreatedProp) .withProperty("isLatest", true)) .wrap(); DatabaseFixer instance = new DatabaseFixer(graphWrapper); instance.fix(); assertThat(graphWrapper.getGraph().traversal().V().has("tim_id", "id1").toList(), containsInAnyOrder( likeVertex().withTimId("id1").withProperty("rev", 1).withProperty("modified", vertex1CreatedProp), likeVertex().withTimId("id1").withProperty("rev", 2) )); assertThat(graphWrapper.getGraph().traversal().V().has("tim_id", "id2").toList(), containsInAnyOrder( likeVertex().withTimId("id2").withProperty("rev", 1).withProperty("modified", vertex2CreatedProp), likeVertex().withTimId("id2").withProperty("rev", 2).withProperty("modified", vertex2CreatedProp), likeVertex().withTimId("id2").withProperty("rev", 3) )); }
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);  }