【Junit】The import org.junit.Test conflicts with a type defined in the same file报错

引入Junit后,进行单元测试,莫名其妙报了个这样的错误

The import org.junit.Test conflicts with a type defined in the same file

  • 原因一:常规原因,导入的jar包相冲突
  • 原因二:狗血原因,写junit测试的Java类名为Test.java

我的错误是类名用了Test。欲哭无泪!

原文地址:https://www.cnblogs.com/anny0404/p/5275610.html