AndroidStudio/Gradle with powermock

后端 未结 7 1536
小鲜肉
小鲜肉 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条回答
  •  Happy的楠姐
    2020-12-29 01:56

    I have used same as @Bhargav used with some additional features added with it

    • code coverage for test case (if testCoverageEnabled is true, then it enable Jacoco tool)
    • unit test will test only your code and do not depend on any particular behaviour of Android platform by using (UnitTests.returnDefaultValues = true)

    Add this marked lines in build.gradle to enable JUnit, PowerMockito, JaCoCo

提交回复
热议问题