【问题标题】:Test suite execution in Spring boot application with dependencies pom具有依赖项 pom 的 Spring Boot 应用程序中的测试套件执行
【发布时间】:2019-07-14 03:36:35
【问题描述】:

当我在我们的应用程序中尝试使用一些测试套件时,例如,带有注释:

@RunWith(Suite.class)
@SuiteClasses({ShowControllerStandaloneTest.class})

我发现如果我们使用 spring-boot-dependencies,并使用 mvn clean install 运行我们的应用程序,这样的测试套件会被完全忽略。但是,如果我们使用 spring-boot-starter 作为父 pom,则在 mvn clean install 期间会考虑测试套件。

知道我是否在这里遗漏了一些配置?我用 maven 尝试了许多插件选项,但没有帮助。

【问题讨论】:

    标签: maven spring-boot spring-boot-test test-suite


    【解决方案1】:

    我通过将测试套件类重命名为与源类具有相同的名称加上前缀“Test”并具有相同的包结构来解决此问题。只有这样 Maven 安装、测试等才选择这个套件类。 @SpringBoot 团队,这是一个错误吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-23
      • 2018-10-07
      • 2015-02-02
      • 2019-12-23
      • 1970-01-01
      • 1970-01-01
      • 2017-06-24
      相关资源
      最近更新 更多