我将junit
的版本提升到了4.11,并得到:
[WARNING] [deprecation] Assert in junit.framework has been deprecated
[WARNING] [deprecation] Assert in junit.framework has been deprecated
....
如何迁移以及迁移到什么?
发布于 2014-06-03 19:03:01
在JUnit 4.0中,Assert类似乎已经从junit.framework
移到了org.junit.Assert
-你可以用它来代替,它并没有被弃用。
发布于 2014-08-25 17:24:04
将导入语句从
import junit.framework.Assert;
至
import org.junit.Assert;
这将纠正您的JUnit弃用警告。
发布于 2017-01-20 17:38:02
我们进行了大量的测试,其中包含许多断言。
添加像这样的东西
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
导入语句也有助于限制测试代码中的更改。
https://stackoverflow.com/questions/24013210
复制相似问题