From d9c13f8ab0cbf9d1351a69dc0a561ec7759653c5 Mon Sep 17 00:00:00 2001 From: JB Date: Thu, 9 Dec 2021 16:15:03 +0000 Subject: [PATCH] added Hakan's suggestions --- src/test/java/DocsTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/java/DocsTest.java b/src/test/java/DocsTest.java index 574414d7..5069ebb3 100644 --- a/src/test/java/DocsTest.java +++ b/src/test/java/DocsTest.java @@ -13,32 +13,32 @@ import java.util.Set; import java.util.stream.Collectors; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; import org.neo4j.exceptions.KernelException; import org.neo4j.graphdb.GraphDatabaseService; +import org.neo4j.harness.Neo4j; +import org.neo4j.harness.Neo4jBuilders; import org.neo4j.kernel.api.procedure.GlobalProcedures; import org.neo4j.kernel.internal.GraphDatabaseAPI; -import org.neo4j.test.rule.DbmsRule; -import org.neo4j.test.rule.ImpermanentDbmsRule; import org.reflections.Reflections; import org.reflections.scanners.SubTypesScanner; import org.reflections.util.ConfigurationBuilder; public class DocsTest { - @Rule - public DbmsRule db = new ImpermanentDbmsRule(); + private static Neo4j db; @Before public void setUp() throws Exception { + db = Neo4jBuilders.newInProcessBuilder().withDisabledServer().build(); + Set> allClasses = allClasses(); assertFalse(allClasses.isEmpty()); for (Class klass : allClasses) { if (!klass.getName().endsWith("Test")) { - registerProcedure(db, klass); + registerProcedure(db.defaultDatabaseService(), klass); } } @@ -79,7 +79,7 @@ public void generateDocs() { // given List rows = new ArrayList<>(); - List procedureRows = db.executeTransactionally( + List procedureRows = db.defaultDatabaseService().executeTransactionally( "CALL dbms.procedures() YIELD signature, name, description WHERE name STARTS WITH 'n10s' RETURN 'procedure' AS type, name, description, signature ORDER BY signature", Collections.emptyMap(), result -> result.stream().map(record -> new Row( @@ -90,7 +90,7 @@ public void generateDocs() { ).collect(Collectors.toList())); rows.addAll(procedureRows); - List functionRows = db.executeTransactionally( + List functionRows = db.defaultDatabaseService().executeTransactionally( "CALL dbms.functions() YIELD signature, name, description WHERE name STARTS WITH 'n10s' RETURN 'function' AS type, name, description, signature ORDER BY signature", Collections.emptyMap(), result -> result.stream().map(record -> new Row(