Junit4单元测试报错:method \’initializationError\’ not found: Opening the test classs

1.缺包

除了junit还需要hamcrest-core和hamcrest-library。

下载:https://mvnrepository.com/

2.包版本不对

junit-4.13.jar,对应可以用网上大家普遍用的 hamcrest-core-1.3.jar和hamcrest-library-1.3.jar

而最新版hamcrest-core-2.2.jar和hamcrest-library-2.2.jar不行。

 

 

 

 

参考:

https://www.cnblogs.com/zlslch/p/8961587.html

版权声明:本文为sybil-hxl原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/sybil-hxl/p/13217950.html