springboot单元测试报错:no tests were found,如图所示: 原因分析: 1、进行单元测试的方法不能有返回值 2、方法不能私有化。 以上两个问题都会报 no tests were found 错误。 正确写法: