# Error while running junit : Error starting neo4j database server at '...\\data\\database '

**URL:** <https://community.neo4j.com/t/error-while-running-junit-error-starting-neo4j-database-server-at-data-database/40530>\
**Category:** Neo4j Graph Platform\
**Created:** [June 28, 2021, 1:14pm UTC](https://community.neo4j.com/t/error-while-running-junit-error-starting-neo4j-database-server-at-data-database/40530 "2021-06-28T13:14:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankit.bagaria](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ankit.bagaria/32/4113_2.png) [@ankit.bagaria](https://community.neo4j.com/u/ankit.bagaria)\
**Post date:** [June 28, 2021, 1:14pm UTC](https://community.neo4j.com/t/error-while-running-junit-error-starting-neo4j-database-server-at-data-database/40530/1 "2021-06-28T13:14:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)\
**Post date:** [July 2, 2021, 11:02pm UTC](https://community.neo4j.com/t/error-while-running-junit-error-starting-neo4j-database-server-at-data-database/40530/2 "2021-07-02T23:02:58Z")

</div>

Better to use testcontainers.

Otherwise @michael.simons has written a great blog post about testing with Neo4j

> **[Testing your Neo4j-based Java application](https://medium.com/neo4j/testing-your-neo4j-based-java-application-34bef487cc3c)**
>
> In this post I’m gonna present different approaches how you can test your Neo4j-based application. As you might know, Neo4j can be…

---

<div class="post-metadata">

**Author:** ![ankit.bagaria](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ankit.bagaria/32/4113_2.png) [@ankit.bagaria](https://community.neo4j.com/u/ankit.bagaria)\
**Post date:** [July 14, 2021, 5:05pm UTC](https://community.neo4j.com/t/error-while-running-junit-error-starting-neo4j-database-server-at-data-database/40530/3 "2021-07-14T17:05:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)\
**Post date:** [July 15, 2021, 11:17am UTC](https://community.neo4j.com/t/error-while-running-junit-error-starting-neo4j-database-server-at-data-database/40530/4 "2021-07-15T11:17:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ankit.bagaria](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ankit.bagaria/32/4113_2.png) [@ankit.bagaria](https://community.neo4j.com/u/ankit.bagaria)\
**Post date:** [July 16, 2021, 9:21am UTC](https://community.neo4j.com/t/error-while-running-junit-error-starting-neo4j-database-server-at-data-database/40530/5 "2021-07-16T09:21:36Z")

</div>

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
