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

posted on 2020-07-01 10:46  西伯尔  阅读(434)  评论(0编辑  收藏  举报