use of nl.knaw.huygens.timbuctoo.core.dto.RelationType in project timbuctoo by HuygensING.
the class TinkerPopOperationsTest method getEntityOmitsDeletedRelations.
@Test
public void getEntityOmitsDeletedRelations() throws Exception {
Vres vres = createConfiguration();
Collection collection = vres.getCollection("testthings").get();
UUID id = UUID.randomUUID();
UUID relatedId = UUID.randomUUID();
TinkerPopGraphManager graphManager = newGraph().withVertex("source", v -> v.withOutgoingRelation("isRelatedTo", "relatedThing", rel -> rel.withDeleted(true)).withOutgoingRelation("hasOtherRelationWith", "relatedThing").withVre("test").withVre("").withType("thing").isLatest(true).withTimId(id.toString())).withVertex("relatedThing", v -> v.withVre("test").withVre("").withType("thing").withTimId(relatedId.toString()).withProperty("testthing_displayName", "displayName")).wrap();
TinkerPopOperations instance = forGraphWrapperAndMappings(graphManager, vres);
ReadEntity entity = instance.getEntity(id, null, collection, (readEntity, vertex) -> {
}, (graphTraversalSource, vre, vertex, relationRef) -> {
});
assertThat(entity.getRelations(), hasSize(1));
assertThat(entity.getRelations(), contains(hasProperty("relationType", equalTo("hasOtherRelationWith"))));
}
Aggregations