@Test public void onCreateAddsItemsToTheIndexOfTheProvidedCollection() { IndexHandler indexHandler = mock(IndexHandler.class); GraphWrapper graphWrapper = newGraph() .withVertex(v -> v .withProperty("vrecoll_name", "foo") ) .wrap(); FulltextIndexChangeListener instance = new FulltextIndexChangeListener(indexHandler, graphWrapper); Collection collection = new VresBuilder() .withVre("thevre", "vre", vre -> vre .withCollection("vrecolls", coll -> coll .withDisplayName(localProperty("vrecoll_name")) ) ) .build().getCollection("vrecolls").get(); Vertex vertex = graphWrapper.getGraph().traversal().V().next(); instance.onCreate(collection, vertex); verify(indexHandler).upsertIntoQuickSearchIndex(collection, "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);  }