Spring 启动集成测试找不到配置

Spring Boot integration test can't find configuration

我有一个简单的 Spring 引导应用程序,仅包含此 class:

@SpringBootApplication
public class TestApplication {

    public static void main(String[] args) {
        SpringApplication.run(TestApplication.class, args);
    }
}

我想测试应用程序是否启动。该测试如下所示:

@SpringBootTest
public class UserServiceIT {

    @Test
    public void testContextLoads() {
        assertTrue(true);
    }

}

当我 运行 这个来自我的 IDE (IntelliJ) 的测试时,它通过了。这是预期的行为。

当我从命令行 (mvn integration-test) 运行 时,出现以下故障:

java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test

我使用的是以下版本:

关于为什么这在命令行上失败的任何想法?

我尝试将 maven-failsafe-plugin 的版本回滚到 3.0.0.M4 并且测试通过了命令行。因此这似乎是 3.0.0.M5.

中的错误