当前位置:网站首页>TestEngine with ID ‘junit-vintage‘ failed to discover tests

TestEngine with ID ‘junit-vintage‘ failed to discover tests

2022-06-12 13:47:00 天狼1222

在进行单元测试的时候,启动报错:

TestEngine with ID 'junit-vintage' failed to discover tests

看了网上说的,由于spring-boot-starter-test默认使用Junit5,但是vintage引擎还是默认包含了,由此可见虽然我使用Junit5还是需要手工排除排除junit-vintage-engine依赖。最终项目依赖为:

  testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }

这样处理了,还是报一样的错? 把测试模块重新编译下。可能新加的单元测试,没有编译到,读取不到导致的。

重新编译后,再进行,应该就可以了 

原网站

版权声明
本文为[天狼1222]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_35461948/article/details/125221090