use of org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException in project timbuctoo by HuygensING.
the class CollectionTest method removeDoesNothingWhenTheEntityIsNotPartOfTheCollection.
@Test
public void removeDoesNothingWhenTheEntityIsNotPartOfTheCollection() {
GraphWrapper graphWrapper = newGraph().withVertex("collection", v -> v.withLabel(DATABASE_LABEL).withOutgoingRelation(HAS_ENTITY_NODE_RELATION_NAME, "entityNode").withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, ENTITY_NAME).withProperty(COLLECTION_NAME_PROPERTY_NAME, COLLECTION_NAME)).withVertex("entityNode", v -> {
}).withVertex("entity", v -> v.withLabel("entity")).wrap();
Vertex collectionVertex = graphWrapper.getGraph().traversal().V().has(T.label, LabelP.of(DATABASE_LABEL)).next();
Vertex entityVertex = graphWrapper.getGraph().traversal().V().has(T.label, LabelP.of("entity")).next();
Collection instance = new Collection(VRE_NAME, collectionVertex, graphWrapper);
try {
instance.remove(entityVertex);
} catch (FastNoSuchElementException e) {
fail("Should not throw an exception.");
}
}
Aggregations