简体   繁体   中英

How to unit test Neo4j with Scala?

I need to test some Neo4J queries in my unit/integration tests with Scala.

Is there any way to do it? the only solution is Neo4j embbeded?

I do not recommend to test against embedded or use the embedded option. If you have the chance to try the latest Neo4J, version +3.0, you will be able to get a performance improvement as version +3.0 introduced the Bolt protocol .

Prior to 3.0 you had to either use the REST endpoints, that you can easily test using scalatest,etc..., or go with the embedded option, which is explicitly discouraged as stated in the documentation. Other libraries are available, such as Anormcypher, to access Neo4j prior to 3.0v.

If you are able to use +3.0 you can use the Java API https://github.com/neo4j/neo4j-java-driver

There is a similar question available at SO: Neo4j - Unit testing REST Api calls

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM