IDEA使用JUnit时@Test无效以及无法导入org.junit包的一系列问题

先找到idea的安装位置,进入lib文件夹

然后打开idea,File -> Project Structure。选择Project Settings中的Libraries,点击如图“+”号。
IDEA使用JUnit时@Test无效以及无法导入org.junit包的一系列问题

IDEA使用JUnit时@Test无效以及无法导入org.junit包的一系列问题

然后添加以下两个包
IDEA使用JUnit时@Test无效以及无法导入org.junit包的一系列问题
IDEA使用JUnit时@Test无效以及无法导入org.junit包的一系列问题
点击OK,添加成功就可以了

https://blog.csdn.net/danmo_wuhen/article/details/104117243感谢大佬分享