【问题标题】:How do I set up a Spring Data Neo4j integration test with JUnit 5 (in Kotlin)?如何使用 JUnit 5(在 Kotlin 中)设置 Spring Data Neo4j 集成测试?
【发布时间】:2020-03-06 03:36:23
【问题描述】:

Web 上使用 Neo4j 进行 Spring 集成测试的大多数示例仍在 JUnit 4 上,并使用 Neo4jRule。

我们如何为 Neo4j + Spring + JUnit 5 创建设置?

【问题讨论】:

    标签: spring neo4j spring-data-neo4j spring-test junit5


    【解决方案1】:

    如果您在嵌入式上进行测试,请使用带有简单 Spring 配置的测试工具。

    这里有一些例子:

    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

    我会关注上面的^^ 这个和测试容器将是我们前进的方向。

    注意:@Neo4jExtension 主要由核心团队内部使用,不推荐用于一般用途。

    【讨论】:

    • Michael,不推荐 Neo4jExtension 还是真的吗?我之所以问,是因为这感觉它与 “对官方测试支持类的支持。从 4.0 开始,Neo4j 为社区和企业用户提供一组 Junit 4 规则和 Junit 5 扩展。” 来自@ 987654325@
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-15
    • 2018-07-29
    • 2019-06-04
    • 1970-01-01
    • 2019-01-04
    • 2015-06-17
    • 1970-01-01
    相关资源
    最近更新 更多