问题描述
在Web上使用Neo4j进行Spring集成测试的大多数示例仍在JUnit 4上,并使用Neo4jRule.
Most examples around the Web for doing Spring integration tests with Neo4j are still on JUnit 4, and use the Neo4jRule.
我们如何为Neo4j + Spring + JUnit 5创建设置?
How do we create a setup for Neo4j + Spring + JUnit 5?
推荐答案
如果要在嵌入式系统上进行测试,请使用带有简单Spring配置的Test Harness.
If you are testing on embedded, please use the Test Harness with a simple Spring Configuration.
以下是一些示例:
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
我会关注上面的^^这个和测试容器将是我们前进的道路.
I would have an eye on the above ^^This and test containers will be our way forward.
注意:@ Neo4jExtension通常由核心团队在内部使用,不建议用于一般用途.
Note: The @Neo4jExtension is mostly used internally by the core team and not recommended for general use.
这篇关于如何使用JUnit 5(在Kotlin中)设置Spring Data Neo4j集成测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!