AndroidStudio/Gradle with powermock

后端 未结 7 1417
小鲜肉
小鲜肉 2020-12-29 01:28

I couldn\'t find any info on how to setup powermock with Android Studio/Gradle. Everything I\'ve tried resulted in build exceptions.

Could anybody show a correct way

7条回答
  •  一生所求
    2020-12-29 01:45

    Add the following lines to your dependencies{} block:

    testCompile 'junit:junit:4.12'
    testCompile 'org.powermock:powermock:1.6.5'
    testCompile 'org.powermock:powermock-module-junit4:1.6.5'
    

    And if you would like to use PowerMockito, add the following line:

    testCompile 'org.powermock:powermock-api-mockito:1.6.5'
    

提交回复
热议问题