Search code examples
unit-testingneo4jjunit5

Creating MOCK UP Data for Neo4j Unit testing


I want to do unit testing for my application in neo4j with java code .We are writing junit test cases for it. But we want when we run the junit test cases it should not communicate it to the main database rather then some other mockup data.

We are using neo4j server and no embedded database is used.

How could this be achieved?

How can we create mockup data for testing neo4j related code?

How to create a mocked database for unit testing so that main database not be touched.

Is there any tool to mock the main database or we have to do it manually through the code?


Solution

  • We've got a great article on testing your Neo4j-based Java application that should give you a few options for testing.