如何使用JUnit 5(在Kotlin中)设置Spring Data Neo4j集成测试? [英] How do I set up a Spring Data Neo4j integration test with JUnit 5 (in Kotlin)?

查看:166
本文介绍了如何使用JUnit 5(在Kotlin中)设置Spring Data Neo4j集成测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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

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.

注意:@ Neo4jExtension通常由核心团队在内部使用,不建议用于一般用途.

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

这篇关于如何使用JUnit 5(在Kotlin中)设置Spring Data Neo4j集成测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆