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

查看:37
本文介绍了如何使用 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 配置的测试工具.

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-harnesshttps://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天全站免登陆