/www/wwwroot/blog.drearry.com/usr/plugins/AMP/templates/MIPpage.php on line 33
">

单元测试报错: org.junit.runners.model.InvalidTestClassError: Invalid test class

2023-06-29T11:39:00

单元测试通过,但是结束之后会报错:

org.junit.runners.model.InvalidTestClassError: Invalid test class 
'com.itheima.chapter03.Chapter03ApplicationTests':
1. No runnable methods

问题原因:使用了 org.junit.jupiter.api.Test
解决办法:使用 org.junit.Test

#错误示例
import org.junit.jupiter.api.Test;
#正确示例
import org.junit.Test;
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »