https://kotlinlang.org logo
#mockk
Title
d

Diego Almeida de Oliveira

05/13/2020, 12:08 PM
I'm not sure it's the same as extension functions. I had checked this part of the documentation before and it doesn't say anything about extension properties. I did check the bytecode and the extension property is turned into a static function, so for my example there's static
getSomeProperty()
function. But how could I access this function from my tests? Just doing
every { spy.someProperty }.returns("test")
doesn't work. I also tried mocking the generated function (
getSomeProperty()
) using dynamic calls but didn't work either (I believe dynamic calls are for private properties/functions only)