且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Maven没有运行Spring Boot测试

更新时间:2022-10-31 16:50:14

您命名为TestController的类中的代码不是控制器,它是一个测试,但是约定表示它是控制器(可能在测试中使用) ).默认情况下,Surefire将寻找与*Test匹配的测试;将类重命名为ControllerTest.

The code in the class you named TestController isn't a controller, it's a test, but the convention says that it's a controller (perhaps used in testing). By default, Surefire will be looking for tests matching *Test; rename the class to ControllerTest.