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

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

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'
    }

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

TestEngine with ID ‘junit-vintage‘ failed to discover tests_第1张图片

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

你可能感兴趣的:(错误处理,单元测试)