use of nl.knaw.huygens.timbuctoo.core.dto.CreateCollection in project timbuctoo by HuygensING.
the class TinkerPopOperationsTest method addCollectionToVreDoesNotAddTheCollectionWhenTheVreAlreadyHasACollectionWithTheSameName.
@Test
public void addCollectionToVreDoesNotAddTheCollectionWhenTheVreAlreadyHasACollectionWithTheSameName() {
TinkerPopGraphManager graphManager = newGraph().wrap();
TinkerPopOperations instance = forGraphWrapper(graphManager);
Vre vre = instance.ensureVreExists("vre");
CreateCollection collection = CreateCollection.forEntityTypeName("entityTypeName");
instance.addCollectionToVre(vre, collection);
instance.addCollectionToVre(vre, collection);
assertThat(graphManager.getGraph().traversal().V().hasLabel(Collection.DATABASE_LABEL).has(ENTITY_TYPE_NAME_PROPERTY_NAME, collection.getEntityTypeName(vre)).count().next(), is(1L));
}
use of nl.knaw.huygens.timbuctoo.core.dto.CreateCollection in project timbuctoo by HuygensING.
the class TinkerPopOperationsTest method addCollectionToVreAddsACollectionToTheVre.
@Test
public void addCollectionToVreAddsACollectionToTheVre() {
TinkerPopOperations instance = TinkerPopOperationsStubs.newInstance();
Vre vre = instance.ensureVreExists("vre");
CreateCollection collection = CreateCollection.forEntityTypeName("entityTypeName");
instance.addCollectionToVre(vre, collection);
Vres vres = instance.loadVres();
Vre vre1 = vres.getVre("vre");
assertThat(vre1.getCollectionForCollectionName(collection.getCollectionName(vre1)), is(present()));
}
Aggregations