I'm using Mockk and I want to test a MediatorLiveData that depends of some boolean properties of the class.
I was using mockkConstructor(Boolean::class)
but suddenly a warning appears on the console log and all the test cases fails (I'm not sure but seems to be happening after updating the Kotlin version)
WARNING: Non instrumentable classes(skipped): boolean
Class to test
class Testeando {
var testBool = false
fun test() : Boolean {
return testBool
}
}
This is the minimum possible code to replicate the error (Not the real test). the line of mocking the value of testBool is ignored.
@Test
fun `Just a test`() {
mockkConstructor(Boolean::class)
val t =spyk(Testeando())
every{t.testBool }returns true
assertTrue(t.test())
}
What I'm doing wrong?