Spring Boot单元测试错误:no tests found with test runner “Junit5”

单元测试错误:no tests found with test runner “Junit5”


Spring Boot单元测试错误:no tests found with test runner “Junit5”

只需按照下面操作就可以:
1、在单元测试的文件上右键出来Run as 选择 Run Configuration

Spring Boot单元测试错误:no tests found with test runner “Junit5”

2、在出来的界面把Test runner选择成当前所使用的,我的是Junit4.然后点击run,成功。

Spring Boot单元测试错误:no tests found with test runner “Junit5”