springboot method initializationerror not found.opening the test class.

问题描述:springboot method ‘initializationerror’ not found.opening the test class.
大致意思为:找不到要启动的类
springboot method initializationerror not found.opening the test class._第1张图片但是同样的设置在别的项目里就可以运行,修改一样的pom.xml文件也无效。
网上扒拉一大堆都是缺少jar。我这已经从maven仓库下载好了。。。。。。
在不懈努力下,成功找到正确方法:指定启动类:相关内容传送门

@SpringBootTest(classes= {SpringBoot2ApplicationTests.class})   

在这里插入图片描述完美运行:
在这里插入图片描述
参考:
SpringBoot单元测试报错问题method initializationerror not found:JUnit4
SpringBoot2.X (十四): @SpringBootTest单元测试

你可能感兴趣的:(遇到问题到解决,Java,Web学习之路)