@Test public void doesNotThrowWhenDisplayNameTraversalYieldsNoResults() { final String theMissingPropertyName = "missingProperty_name"; IndexHandler indexHandler = mock(IndexHandler.class); GraphWrapper graphWrapper = newGraph() .withVertex("newVertex", v -> v .withProperty("locateMe", "here") ) .wrap(); FulltextIndexChangeListener instance = new FulltextIndexChangeListener(indexHandler, graphWrapper); Collection collection = new VresBuilder() .withVre("thevre", "vre", vre -> vre .withCollection("vrecolls", coll -> coll .withDisplayName(localProperty(theMissingPropertyName)) ) ) .build().getCollection("vrecolls").get(); Vertex newVertex = graphWrapper.getGraph().traversal().V().has("locateMe", "here").next(); instance.onAddToCollection(collection, Optional.empty(), newVertex); }
@Override public void onAddToCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex) { handleChange(collection, newVertex, oldVertex.orElse(null)); }
FulltextIndexChangeListener implements ChangeListener { @Override public void onAddToCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex) { handleChange(collection, newVertex, oldVertex.orElse(null)); } }
FulltextIndexChangeListener implements ChangeListener { @Override public void onAddToCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex) { handleChange(collection, newVertex, oldVertex.orElse(null)); } FulltextIndexChangeListener(IndexHandler indexHandler, GraphWrapper graphWrapper); }
FulltextIndexChangeListener implements ChangeListener { @Override public void onAddToCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex) { handleChange(collection, newVertex, oldVertex.orElse(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 onAddToCollection(Collection collection, Optional<Vertex> oldVertex, Vertex newVertex) { handleChange(collection, newVertex, oldVertex.orElse(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);  }