Search in sources :

Example 16 with GraphWrapper

use of nl.knaw.huygens.timbuctoo.server.GraphWrapper in project timbuctoo by HuygensING.

the class GraphLogValidatorTest method writeReportWritesALineForEachInvalidEdge.

@Test
public void writeReportWritesALineForEachInvalidEdge() throws Exception {
    GraphWrapper wrapper = newGraph().withVertex("v1", v -> v.withTimId(VERTEX_ID_1).withProperty("rev", 1).withLabel("document")).withVertex("v2", v -> v.withTimId(VERTEX_ID_2).withProperty("rev", 1).withLabel("document").withOutgoingRelation("relatedTo", "v1", r -> r.withTim_id(REL_1_ID).withRev(1)).withOutgoingRelation("relatedTo", "v1", r -> r.withTim_id(REL_1_ID).withRev(2)).withOutgoingRelation("otherRelation", "v1", r -> r.withTim_id(REL_2_ID).withRev(1)).withOutgoingRelation("otherRelation", "v1", r -> r.withTim_id(REL_2_ID).withRev(2))).withVertex("v3", v -> v.withLabel("createVertexEntry").withProperty("TIM_tim_id", VERTEX_ID_1).withProperty("rev", 1).withOutgoingRelation("NEXT_ITEM", "v4")).withVertex("v4", v -> v.withLabel("updateVertexEntry").withProperty("TIM_tim_id", VERTEX_ID_2).withProperty("rev", 1).withOutgoingRelation("NEXT_ITEM", "v5")).withVertex("v5", v -> v.withLabel("createEdgeEntry").withProperty("TIM_tim_id", REL_2_ID.toString()).withProperty("rev", 1).withOutgoingRelation("NEXT_ITEM", "v6")).withVertex("v6", v -> v.withLabel("updateEdgeEntry").withProperty("TIM_tim_id", REL_2_ID.toString()).withProperty("rev", 2)).wrap();
    GraphLogValidator graphLogValidator = new GraphLogValidator(wrapper);
    Writer writer = mock(Writer.class);
    graphLogValidator.writeReport(writer);
    ArgumentCaptor<String> stringArgumentCaptor = ArgumentCaptor.forClass(String.class);
    verify(writer, times(2)).write(stringArgumentCaptor.capture());
    assertThat(stringArgumentCaptor.getAllValues(), containsInAnyOrder(stringContainsInOrder(Lists.newArrayList("Edge", REL_1_ID.toString(), "1")), stringContainsInOrder(Lists.newArrayList("Edge", REL_1_ID.toString(), "2"))));
    verifyNoMoreInteractions(writer);
}
Also used : StringContainsInOrder.stringContainsInOrder(org.hamcrest.text.StringContainsInOrder.stringContainsInOrder) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) UUID(java.util.UUID) Mockito.verify(org.mockito.Mockito.verify) Assert.assertThat(org.junit.Assert.assertThat) Lists(com.google.common.collect.Lists) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) ArgumentCaptor(org.mockito.ArgumentCaptor) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Writer(java.io.Writer) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) Mockito.mock(org.mockito.Mockito.mock) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) Writer(java.io.Writer) Test(org.junit.Test)

Example 17 with GraphWrapper

use of nl.knaw.huygens.timbuctoo.server.GraphWrapper in project timbuctoo by HuygensING.

the class D3GraphGeneratorServiceTest method getShouldGenerateAD3Graph.

@Test
public void getShouldGenerateAD3Graph() throws NotFoundException, IOException {
    Graph graph = newGraph().withVertex("relationCollection", v -> v.withProperty(Collection.ENTITY_TYPE_NAME_PROPERTY_NAME, "wwrelation").withProperty(Collection.IS_RELATION_COLLECTION_PROPERTY_NAME, true)).withVertex("vreNode", v -> v.withProperty(Vre.VRE_NAME_PROPERTY_NAME, "WomenWriters").withOutgoingRelation(Vre.HAS_COLLECTION_RELATION_NAME, "relationCollection")).withVertex(v -> v.withLabel(Collection.DATABASE_LABEL).withProperty(Collection.ENTITY_TYPE_NAME_PROPERTY_NAME, "wwperson").withIncomingRelation(Vre.HAS_COLLECTION_RELATION_NAME, "vreNode")).withVertex("v1", v -> v.withProperty("isLatest", true).withTimId(THE_UUID).withProperty("types", TYPES).withProperty("wwperson_tempName", "name1")).withVertex("v2", v -> v.withTimId("2").withProperty("types", TYPES).withOutgoingRelation(RELATION_NAME, "v1", r -> r.withAccepted("wwrelation", true).withIsLatest(true)).withProperty("wwperson_tempName", "name2")).withVertex("v3", v -> v.withTimId("3").withProperty("types", TYPES).withOutgoingRelation(RELATION_NAME_2, "v1", r -> r.withAccepted("wwrelation", true).withIsLatest(true)).withProperty("wwperson_tempName", "name3")).withVertex("v4", v -> v.withTimId("4").withProperty("types", TYPES).withOutgoingRelation(RELATION_NAME, "v2", r -> r.withAccepted("wwrelation", true).withIsLatest(true)).withProperty("wwperson_tempName", "name4")).withVertex("v5", v -> v.withTimId("5").withProperty("types", TYPES).withOutgoingRelation(UNREQUESTED_RELATION, "v1", r -> r.withAccepted("wwrelation_accepted", true).withIsLatest(true)).withProperty("wwperson_tempName", "name5")).withVertex("v6", v -> v.withTimId("6").withProperty("types", TYPES).withOutgoingRelation(RELATION_NAME, "v4", r -> r.withAccepted("wwrelation", true).withIsLatest(true)).withProperty("wwperson_tempName", "name6")).build();
    List<Vertex> vertices = graph.traversal().V().has("wwperson_tempName").asAdmin().clone().toList();
    Collections.sort(vertices, Comparator.comparing(vertexA -> ((String) vertexA.property("wwperson_tempName").value())));
    GraphWrapper graphWrapper = createGraphWrapper(graph);
    D3GraphGeneratorService underTest = new D3GraphGeneratorService(graphWrapper, HuygensIng.mappings);
    D3Graph result = underTest.get("wwperson", UUID.fromString(THE_UUID), Lists.newArrayList(RELATION_NAME, RELATION_NAME_2), 2);
    assertThat(result.getNodes().get(0), is(new Node(vertices.get(0), "wwperson")));
    assertThat(result.getNodes(), containsInAnyOrder(new Node(vertices.get(0), "wwperson"), new Node(vertices.get(1), "wwperson"), new Node(vertices.get(2), "wwperson"), new Node(vertices.get(3), "wwperson")));
    int indexOfRoot = getIndex(result.getNodes(), "077bf0b5-6b7d-45aa-89ff-6ecf2cfc549c");
    int indexOfPerson1 = getIndex(result.getNodes(), "2");
    int indexOfPerson2 = getIndex(result.getNodes(), "3");
    int indexOfPerson3 = getIndex(result.getNodes(), "4");
    assertThat(result.getLinks(), containsInAnyOrder(new Link(mockEdge(RELATION_NAME), indexOfRoot, indexOfPerson1), new Link(mockEdge(RELATION_NAME_2), indexOfRoot, indexOfPerson2), new Link(mockEdge(RELATION_NAME), indexOfPerson1, indexOfPerson3)));
}
Also used : HuygensIng(nl.knaw.huygens.timbuctoo.server.HuygensIng) Graph(org.apache.tinkerpop.gremlin.structure.Graph) Test(org.junit.Test) IOException(java.io.IOException) NotFoundException(nl.knaw.huygens.timbuctoo.core.NotFoundException) Collection(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) UUID(java.util.UUID) GraphTraversal(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal) List(java.util.List) Lists(com.google.common.collect.Lists) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) BDDMockito.given(org.mockito.BDDMockito.given) Is.is(org.hamcrest.core.Is.is) Vre(nl.knaw.huygens.timbuctoo.model.vre.Vre) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Comparator(java.util.Comparator) Collections(java.util.Collections) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) GraphTraversalSource(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource) Edge(org.apache.tinkerpop.gremlin.structure.Edge) Mockito.mock(org.mockito.Mockito.mock) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Graph(org.apache.tinkerpop.gremlin.structure.Graph) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) Test(org.junit.Test)

Example 18 with GraphWrapper

use of nl.knaw.huygens.timbuctoo.server.GraphWrapper in project timbuctoo by HuygensING.

the class CollectionTest method addPropertyAddsHasNextEdgeBetweenTheProperties.

@Test
public void addPropertyAddsHasNextEdgeBetweenTheProperties() {
    GraphWrapper graphWrapper = newGraph().withVertex(v -> v.withLabel(DATABASE_LABEL).withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, ENTITY_NAME).withProperty(COLLECTION_NAME_PROPERTY_NAME, COLLECTION_NAME)).wrap();
    Vertex collectionVertex = graphWrapper.getGraph().traversal().V().next();
    Collection instance = new Collection(VRE_NAME, collectionVertex, graphWrapper);
    instance.addProperty(mock(Vertex.class), "prop1", "val1", type);
    instance.addProperty(mock(Vertex.class), "prop2", "val2", type);
    instance.addProperty(mock(Vertex.class), "prop3", "val3", type);
    assertThat(graphWrapper.getGraph().traversal().V(collectionVertex.id()).out(HAS_INITIAL_PROPERTY_RELATION_NAME).out(HAS_NEXT_PROPERTY_RELATION_NAME).out(HAS_NEXT_PROPERTY_RELATION_NAME).count().next(), is(1L));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) HAS_ARCHETYPE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME) LocalProperty(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty) PROPERTY_TYPE_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.PROPERTY_TYPE_NAME) LabelP(org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP) DATABASE_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty.DATABASE_PROPERTY_NAME) Matchers.not(org.hamcrest.Matchers.not) CLIENT_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.CLIENT_PROPERTY_NAME) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) HAS_INITIAL_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_INITIAL_PROPERTY_RELATION_NAME) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) MockitoHamcrest.argThat(org.mockito.hamcrest.MockitoHamcrest.argThat) HAS_ENTITY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_RELATION_NAME) Assert.fail(org.junit.Assert.fail) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) FastNoSuchElementException(org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException) StringToStringConverter(nl.knaw.huygens.timbuctoo.model.properties.converters.StringToStringConverter) HAS_ENTITY_NODE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_NODE_RELATION_NAME) Iterator(java.util.Iterator) COLLECTION_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.COLLECTION_NAME_PROPERTY_NAME) ENTITY_TYPE_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.ENTITY_TYPE_NAME_PROPERTY_NAME) Test(org.junit.Test) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Mockito.when(org.mockito.Mockito.when) T(org.apache.tinkerpop.gremlin.structure.T) HAS_NEXT_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.HAS_NEXT_PROPERTY_RELATION_NAME) Mockito.verify(org.mockito.Mockito.verify) DATABASE_LABEL(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.DATABASE_LABEL) Mockito.never(org.mockito.Mockito.never) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) EdgeMatcher.likeEdge(nl.knaw.huygens.timbuctoo.util.EdgeMatcher.likeEdge) Matchers.hasItem(org.hamcrest.Matchers.hasItem) HAS_DISPLAY_NAME_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_DISPLAY_NAME_RELATION_NAME) RDF_URI_PROP(nl.knaw.huygens.timbuctoo.rdf.Database.RDF_URI_PROP) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Matchers.is(org.hamcrest.Matchers.is) HAS_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_PROPERTY_RELATION_NAME) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) Test(org.junit.Test)

Example 19 with GraphWrapper

use of nl.knaw.huygens.timbuctoo.server.GraphWrapper in project timbuctoo by HuygensING.

the class CollectionTest method addPropertyDoesNotAddAPropConfigWhenTheCollectionIsAnArchetype.

@Test
public void addPropertyDoesNotAddAPropConfigWhenTheCollectionIsAnArchetype() {
    GraphWrapper graphWrapper = newGraph().withVertex(v -> v.withLabel(DATABASE_LABEL).withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, "concept").withProperty(COLLECTION_NAME_PROPERTY_NAME, "concepts")).wrap();
    Vertex collectionVertex = graphWrapper.getGraph().traversal().V().next();
    CollectionDescription collectionDescription = CollectionDescription.createForAdmin("concept");
    Collection instance = new Collection("Admin", collectionVertex, graphWrapper, collectionDescription);
    Vertex entityVertex = mock(Vertex.class);
    instance.addProperty(entityVertex, "prop1", "val1", type);
    assertThat(graphWrapper.getGraph().traversal().V(collectionVertex.id()).out(HAS_PROPERTY_RELATION_NAME).count().next(), is(0L));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) HAS_ARCHETYPE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME) LocalProperty(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty) PROPERTY_TYPE_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.PROPERTY_TYPE_NAME) LabelP(org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP) DATABASE_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty.DATABASE_PROPERTY_NAME) Matchers.not(org.hamcrest.Matchers.not) CLIENT_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.CLIENT_PROPERTY_NAME) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) HAS_INITIAL_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_INITIAL_PROPERTY_RELATION_NAME) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) MockitoHamcrest.argThat(org.mockito.hamcrest.MockitoHamcrest.argThat) HAS_ENTITY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_RELATION_NAME) Assert.fail(org.junit.Assert.fail) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) FastNoSuchElementException(org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException) StringToStringConverter(nl.knaw.huygens.timbuctoo.model.properties.converters.StringToStringConverter) HAS_ENTITY_NODE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_NODE_RELATION_NAME) Iterator(java.util.Iterator) COLLECTION_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.COLLECTION_NAME_PROPERTY_NAME) ENTITY_TYPE_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.ENTITY_TYPE_NAME_PROPERTY_NAME) Test(org.junit.Test) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Mockito.when(org.mockito.Mockito.when) T(org.apache.tinkerpop.gremlin.structure.T) HAS_NEXT_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.HAS_NEXT_PROPERTY_RELATION_NAME) Mockito.verify(org.mockito.Mockito.verify) DATABASE_LABEL(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.DATABASE_LABEL) Mockito.never(org.mockito.Mockito.never) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) EdgeMatcher.likeEdge(nl.knaw.huygens.timbuctoo.util.EdgeMatcher.likeEdge) Matchers.hasItem(org.hamcrest.Matchers.hasItem) HAS_DISPLAY_NAME_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_DISPLAY_NAME_RELATION_NAME) RDF_URI_PROP(nl.knaw.huygens.timbuctoo.rdf.Database.RDF_URI_PROP) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Matchers.is(org.hamcrest.Matchers.is) HAS_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_PROPERTY_RELATION_NAME) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) Test(org.junit.Test)

Example 20 with GraphWrapper

use of nl.knaw.huygens.timbuctoo.server.GraphWrapper in project timbuctoo by HuygensING.

the class CollectionTest method setArchetypeSetsTheUriOfTheOriginalArchetypeToEdgeToTheArchetype.

@Test
public void setArchetypeSetsTheUriOfTheOriginalArchetypeToEdgeToTheArchetype() {
    String newArchetypeEntity = "newArchetype";
    GraphWrapper graphWrapper = newGraph().withVertex(v -> v.withLabel(DATABASE_LABEL).withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, ENTITY_NAME).withProperty(COLLECTION_NAME_PROPERTY_NAME, COLLECTION_NAME)).withVertex(v -> v.withLabel(DATABASE_LABEL).withProperty(ENTITY_TYPE_NAME_PROPERTY_NAME, newArchetypeEntity)).wrap();
    Vertex collectionVertex = graphWrapper.getGraph().traversal().V().has(T.label, LabelP.of(DATABASE_LABEL)).has(ENTITY_TYPE_NAME_PROPERTY_NAME, ENTITY_NAME).next();
    Collection instance = new Collection(VRE_NAME, collectionVertex, graphWrapper);
    Vertex archetypeVertex = graphWrapper.getGraph().traversal().V().has(T.label, LabelP.of(DATABASE_LABEL)).has(ENTITY_TYPE_NAME_PROPERTY_NAME, newArchetypeEntity).next();
    Collection archetype = new Collection("", archetypeVertex, graphWrapper);
    String originalArchetypeUri = "http://example.com/originalArchetype";
    instance.setArchetype(archetype, originalArchetypeUri);
    assertThat(graphWrapper.getGraph().traversal().V(collectionVertex.id()).outE(HAS_ARCHETYPE_RELATION_NAME).toList(), hasItem(likeEdge().withProperty(RDF_URI_PROP, originalArchetypeUri)));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) HAS_ARCHETYPE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME) LocalProperty(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty) PROPERTY_TYPE_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.PROPERTY_TYPE_NAME) LabelP(org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP) DATABASE_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.LocalProperty.DATABASE_PROPERTY_NAME) Matchers.not(org.hamcrest.Matchers.not) CLIENT_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.CLIENT_PROPERTY_NAME) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) HAS_INITIAL_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_INITIAL_PROPERTY_RELATION_NAME) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) MockitoHamcrest.argThat(org.mockito.hamcrest.MockitoHamcrest.argThat) HAS_ENTITY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_RELATION_NAME) Assert.fail(org.junit.Assert.fail) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) TestGraphBuilder.newGraph(nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph) FastNoSuchElementException(org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException) StringToStringConverter(nl.knaw.huygens.timbuctoo.model.properties.converters.StringToStringConverter) HAS_ENTITY_NODE_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_NODE_RELATION_NAME) Iterator(java.util.Iterator) COLLECTION_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.COLLECTION_NAME_PROPERTY_NAME) ENTITY_TYPE_NAME_PROPERTY_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.ENTITY_TYPE_NAME_PROPERTY_NAME) Test(org.junit.Test) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) Mockito.when(org.mockito.Mockito.when) T(org.apache.tinkerpop.gremlin.structure.T) HAS_NEXT_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.model.properties.ReadableProperty.HAS_NEXT_PROPERTY_RELATION_NAME) Mockito.verify(org.mockito.Mockito.verify) DATABASE_LABEL(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.DATABASE_LABEL) Mockito.never(org.mockito.Mockito.never) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) EdgeMatcher.likeEdge(nl.knaw.huygens.timbuctoo.util.EdgeMatcher.likeEdge) Matchers.hasItem(org.hamcrest.Matchers.hasItem) HAS_DISPLAY_NAME_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_DISPLAY_NAME_RELATION_NAME) RDF_URI_PROP(nl.knaw.huygens.timbuctoo.rdf.Database.RDF_URI_PROP) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Matchers.is(org.hamcrest.Matchers.is) HAS_PROPERTY_RELATION_NAME(nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_PROPERTY_RELATION_NAME) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) VertexMatcher.likeVertex(nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) GraphWrapper(nl.knaw.huygens.timbuctoo.server.GraphWrapper) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Aggregations

GraphWrapper (nl.knaw.huygens.timbuctoo.server.GraphWrapper)31 TestGraphBuilder.newGraph (nl.knaw.huygens.timbuctoo.util.TestGraphBuilder.newGraph)31 Test (org.junit.Test)31 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)28 Mockito.mock (org.mockito.Mockito.mock)25 VertexMatcher.likeVertex (nl.knaw.huygens.timbuctoo.util.VertexMatcher.likeVertex)24 Mockito.verify (org.mockito.Mockito.verify)23 EdgeMatcher.likeEdge (nl.knaw.huygens.timbuctoo.util.EdgeMatcher.likeEdge)22 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)20 MockitoHamcrest.argThat (org.mockito.hamcrest.MockitoHamcrest.argThat)18 Iterator (java.util.Iterator)17 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)17 Mockito.verifyNoMoreInteractions (org.mockito.Mockito.verifyNoMoreInteractions)15 COLLECTION_NAME_PROPERTY_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.COLLECTION_NAME_PROPERTY_NAME)13 DATABASE_LABEL (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.DATABASE_LABEL)13 ENTITY_TYPE_NAME_PROPERTY_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.ENTITY_TYPE_NAME_PROPERTY_NAME)13 HAS_ARCHETYPE_RELATION_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ARCHETYPE_RELATION_NAME)13 HAS_DISPLAY_NAME_RELATION_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_DISPLAY_NAME_RELATION_NAME)13 HAS_ENTITY_NODE_RELATION_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_NODE_RELATION_NAME)13 HAS_ENTITY_RELATION_NAME (nl.knaw.huygens.timbuctoo.core.dto.dataset.Collection.HAS_ENTITY_RELATION_NAME)13