NoSuchMethodError with Hamcrest 1.3 & JUnit 4.11

前端 未结 8 1364
独厮守ぢ
独厮守ぢ 2020-12-30 19:03

Another instance of the NoSuchMethodError for the JUnit & Hamcrest combination. Offending code:

assertThat(dirReader.document(0).getFields()         


        
8条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 19:20

    What worked for me was to reorder dependencies. Instead of going mockito, junit, I had to put junit, mockito.

    Mockito 1.9.5 uses hamcrest 1.1 which is incompatible and causes problems.

提交回复
热议问题