Spring Cloud Stream / Spring Boot 3 中的 test-binder 发生了什么?

问题描述 投票:0回答:1

我找不到任何相关文档,但是 Spring Cloud Stream / Spring Boot 3 的测试绑定程序发生了什么?

此用法可以很好地处理 2021 bom 导入,但现在出现此错误: 找不到 spring-cloud-stream-4.0.4-test-binder.jar (org.springframework.cloud:spring-cloud-stream:4.0 .4).

build.gradle

dependencies {
    implementation platform("org.springframework.cloud:spring-cloud-dependencies:2022.0.4")
    testImplementation 'org.springframework.cloud:spring-cloud-stream-binder-test'
    testImplementation("org.springframework.cloud:spring-cloud-stream") {
        artifact {
            name = "spring-cloud-stream"
            extension = "jar"
            type = "test-jar"
            classifier = "test-binder"
        }
    }
}

最终目标是使用

@Import(TestChannelBinderConfiguration.class)
InputDestination
OutputDestination
为消费者编写集成测试。

这还支持吗? Spring Boot 3 中 Spring Cloud Stream 的功能接口是否被放弃?如果没有,用

@SpringBootTest
测试的新方法是什么?

java spring-boot spring-cloud-stream
1个回答
0
投票

看来这个还是支持的。有一个可以提供帮助的朋友会有所帮助。不幸的是,这没有足够好的记录,但希望这对其他人有帮助。

org.springframework.cloud:spring-cloud-stream-binder-test
已停产,
test-binder
罐子已移至
org.springframework.cloud:spring-cloud-stream-test-binder

更新build.gradle

dependencies {
    implementation platform("org.springframework.cloud:spring-cloud-dependencies:2022.0.4")
    testImplementation 'org.springframework.cloud:spring-cloud-stream-test-binder'
}

注意依赖名称中testbinder的顺序

GitHub 参考

© www.soinside.com 2019 - 2024. All rights reserved.