Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-28-2021 06:14 AM
Below is the code I am using to start Neo4j database server while running Junit test. (Note the machine is WIndows 10)
Neo4jBuilders.newInProcessBuilder()
.withDisabledServer()
.withProcedure(generateLoops.class)
.withFixture (sw.toString())
.build();
It terminates with error.Below is a part of error trace.
java.lang.RuntimeException: Error starting Neo4j database server at C:\Users\ADMIN\AppData\Local\Temp\5f34f3000325d96991e8b02d689389e2\data\databases
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:207)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:163)
at org.neo4j.harness.internal.InProcessNeo4jBuilder.createNeo(InProcessNeo4jBuilder.java:50)
at org.neo4j.harness.internal.AbstractInProcessNeo4jBuilder.build(AbstractInProcessNeo4jBuilder.java:166)
at org.neo4j.harness.internal.AbstractInProcessNeo4jBuilder.build(AbstractInProcessNeo4jBuilder.java:72)
Any help will be deeply appreciated.
Regards
Ankit
07-02-2021 04:02 PM
Better to use testcontainers.
Otherwise @michael.simons has written a great blog post about testing with Neo4j
07-14-2021 10:05 AM
I went through some of blogs relating to Testcontainer, but am not able to understand how to mock or create embedded instance of database for testing.
07-15-2021 04:17 AM
Did you read the blog from Michael?
Either you have to use the neo4j-harness in the latest version, see the code examples there.
Or with test-containers you have an integration test of all your procedures at the end.
07-16-2021 02:21 AM
I am using a MAC machine.. the unit test cases are running fine while using STS ide, but gives the error (error starting Neo4j database server at ...) while trying to run the test case from terminal using mvn test
All the sessions of the conference are now available online