Setting up Powemockito for static mocking

前端 未结 3 1004
感情败类
感情败类 2021-02-08 13:29

I would like to make use of Powermock with Mockito to mock some static method calls. I have followed instructions and examples from SO as well as the PowerMock Getting Started

3条回答
  •  悲&欢浪女
    2021-02-08 13:53

    Probably, the versions of Powermock and Mockito are not compatible. Fix that and it won't be a n issue anymore.

    Mockito                     PowerMock
    1.10.8+                     1.6.2+
    1.9.5-rc1 - 1.9.5           1.5.0 - 1.5.6
    1.9.0-rc1 & 1.9.0           1.4.10 - 1.4.12
    1.8.5                       1.3.9 to 1.4.9
    1.8.4                       1.3.7 & 1.3.8 
    1.8.3                       1.3.6
    1.8.1 & 1.8.2               1.3.5
    1.8                         1.3
    1.7                         1.2.5
    

    See: https://github.com/powermock/powermock/wiki/Mockito#supported-versions

提交回复
热议问题