How can I mock Build.VERSION.SDK_INT in mockk?
I\'ve done the following:
@Test
fun testFoo(){
mockkStatic(Build::class)
mockkStatic(Build.VER
You can build a wrapper around the Build config like this
object MyAppBuildConfig {
fun getVersionSDKInt(): Int {
return Build.VERSION.SDK_INT
}
}
Then mock the MyAppBuildConfig with mockkObject and return your desire version number
mockkObject(MyAppBuildConfig)
every { MyAppBuildConfig.getVersionSDKInt() } returns 22