【发布时间】:2021-11-19 06:28:44
【问题描述】:
我的多模块 Spring Boot 应用程序中有 2 个模块(模块 A 和模块 B),使用 gradle 构建。
现在 Spring Boot 模块的 Main 类出现在模块 A 中。
现在我想在模块 B 中访问这个 Main 类。
在模块 B 中,我想编写集成测试用例和一个测试用例类,我想在 SpringBootTest 注释中提及Main 类。像这样的:
@SpringBootTest(classes = Main.class,
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
class TestController {
}
但是在这里我找不到Main 类。我需要在模块 B 的 gradle 文件中进行哪些更改以支持此功能?
【问题讨论】:
标签: spring-boot gradle integration-testing multi-module