Mock final class with Mockito 2

前端 未结 7 954
醉酒成梦
醉酒成梦 2020-12-01 12:31

I\'m removing Powermock from the project I\'m currently working on, so I\'m trying to rewrite some existing unitary test only with Mockito (mockito-core-2.2.28).

When

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 12:41

    If you have multiple modules in project check out if they also have some references to Mockito. For me the problem was deprecated and unnecessary definition in some other small and forgotten library module:

    testCompile 'org.mockito:mockito-all:1.10.19'
    

    Removing this unnecessary declaration solved the problem for me

提交回复
热议问题