*在SpringBoot基础上执行单元测试,无法执行的原因,下面介绍一下我踩的坑!

会出现这个问题,说明你对springboot有一定了解,在测试方法中没写@Test,或者没有声明为public之类的错误我就不说了:
去看一下你的SpringBoot版本号
gradle项目中:no tests found with test runner 'JUnit5' 单元测试报错
Maven项目中
no tests found with test runner 'JUnit5' 单元测试报错
若你的springboot版本号为2.1.4以上,那么就是因为版本号与Junit5以上的jar包不兼容产生冲突,建议你重新生成springBoot项目,并选择低一点的版本。
no tests found with test runner 'JUnit5' 单元测试报错
再在Eclipse中的Run Configurations页面将Test runner改成Junit4.
no tests found with test runner 'JUnit5' 单元测试报错
no tests found with test runner 'JUnit5' 单元测试报错

我也是初学者,如果原因对不上,请见谅。

相关文章:

  • 2022-12-23
  • 2021-04-03
  • 2021-04-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-06-25
  • 2022-01-13
猜你喜欢
  • 2021-11-21
  • 2022-12-23
  • 2021-04-13
  • 2021-08-09
  • 2021-10-07
  • 2021-11-14
相关资源
相似解决方案