@Test public void onCreateHandlesWwDocumentsUsingCustomLogic() { IndexHandler indexHandler = mock(IndexHandler.class); GraphWrapper graphWrapper = newGraph() .withVertex("doc", v -> v .withProperty("wwdocument_name", "foo") .withOutgoingRelation("isCreatedBy", "authorA", r -> r.withAccepted("wwrelation", true).withIsLatest(true)) .withOutgoingRelation("isCreatedBy", "authorB", r -> r.withAccepted("wwrelation", true).withIsLatest(true)) ) .withVertex("authorA", v -> v .withProperty("wwperson_name", "authorA") ) .withVertex("authorB", v -> v .withProperty("wwperson_name", "authorB") ) .wrap(); FulltextIndexChangeListener instance = new FulltextIndexChangeListener(indexHandler, graphWrapper); Collection collection = new VresBuilder() .withVre("womenwriters", "ww", vre -> vre .withCollection("wwdocuments", coll -> coll .withDisplayName(localProperty("wwdocument_name")) ) .withCollection("wwpersons", coll -> coll .withDisplayName(localProperty("wwperson_name")) ) ) .build().getCollection("wwdocuments").get(); Vertex vertex = graphWrapper.getGraph().traversal().V().next(); instance.onCreate(collection, vertex); verify(indexHandler).upsertIntoQuickSearchIndex(collection, "authorA; authorB foo", vertex, null); }
@Override public void onCreate(Collection collection, Vertex vertex) { handleChange(collection, vertex, null); }
FulltextIndexChangeListener implements ChangeListener { @Override public void onCreate(Collection collection, Vertex vertex) { handleChange(collection, vertex, null); } }
FulltextIndexChangeListener implements ChangeListener { @Override public void onCreate(Collection collection, Vertex vertex) { handleChange(collection, vertex, null); } FulltextIndexChangeListener(IndexHandler indexHandler, GraphWrapper graphWrapper); }
FulltextIndexChangeListener implements ChangeListener { @Override public void onCreate(Collection collection, Vertex vertex) { handleChange(collection, vertex, null); } FulltextIndexChangeListener(IndexHandler indexHandler, GraphWrapper graphWrapper); @Override void onCreate(Collection collection, Vertex vertex); @Override void onPropertyUpdate(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex); @Override void onRemoveFromCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex); @Override void onAddToCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex); @Override void onCreateEdge(Collection collection, Edge edge); @Override void onEdgeUpdate(Collection collection, Edge oldEdge, Edge newEdge); }
FulltextIndexChangeListener implements ChangeListener { @Override public void onCreate(Collection collection, Vertex vertex) { handleChange(collection, vertex, null); } FulltextIndexChangeListener(IndexHandler indexHandler, GraphWrapper graphWrapper); @Override void onCreate(Collection collection, Vertex vertex); @Override void onPropertyUpdate(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex); @Override void onRemoveFromCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex); @Override void onAddToCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex); @Override void onCreateEdge(Collection collection, Edge edge); @Override void onEdgeUpdate(Collection collection, Edge oldEdge, Edge newEdge);  }