How do I set up a Spring Data Neo4j integration test with JUnit 5 (in Kotlin)?

让人想犯罪 __ 提交于 2020-03-16 08:08:10

问题


Most examples around the Web for doing Spring integration tests with Neo4j are still on JUnit 4, and use the Neo4jRule.

How do we create a setup for Neo4j + Spring + JUnit 5?


回答1:


If you are testing on embedded, please use the Test Harness with a simple Spring Configuration.

Here are some examples:

https://medium.com/neo4j/testing-your-neo4j-based-java-application-34bef487cc3c

https://github.com/michael-simons/neo4j-sdn-ogm-tips/tree/master/examples/using-the-test-harness https://github.com/michael-simons/neo4j-sdn-ogm-tips/tree/master/examples/using-testcontainers

https://github.com/neo4j/neo4j-java-driver-spring-boot-starter/tree/master/examples/testing-with-neo4j-harness

I would have an eye on the above ^^ This and test containers will be our way forward.

Note: The @Neo4jExtension is mostly used internally by the core team and not recommended for general use.



来源:https://stackoverflow.com/questions/60557184/how-do-i-set-up-a-spring-data-neo4j-integration-test-with-junit-5-in-kotlin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!