Mock final class with Mockito 2

前端 未结 7 835
醉酒成梦
醉酒成梦 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:51

    This solution worked for me: Instead of

    testCompile "org.mockito:mockito-android:2.9.0"
    

    in the gradle file, replace it with

    testCompile group: 'org.mockito', name: 'mockito-inline', version: '2.9.0' 
    

    and it would work.

    0 讨论(0)
提交回复
热议问题