测试类使用了junit4, spring boot 版本的test 框架自带的是junit5,不兼容。文章来源地址https://www.toymoban.com/news/detail-783135.html
- 按照spring boot 对应的版本的junit框架,修改测试类,比如我就修改了junit5。
- 按照: https://docs.spring.io/spring-boot/docs/2.6.3/reference/html/features.html#features.testing,强制使用junit4
文章来源:https://www.toymoban.com/news/detail-783135.html
到了这里,关于spring boot项目 mvn test 和 mvn clean install 和 mvn test-compile 识别不到测试类无法运行单元测试的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!