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

Thomas Nordmeyer

05/19/2020, 10:34 AM
Hi all, how do I mockk a setter? Gettng complaints in test because the setter is called at init time of a mocked object.
every {mocked.myProperty } returns "some"
mockes the getter. How do I do the same for the setter?
Somewat solved it by setting the mock to "relaxed". Now Mockk does not require all methods called to be mocked explicitly.
e

Erik

05/21/2020, 7:04 PM
You can use
every { mocked.myProperty = any() /* or some other matcher */ } just runs
405 Views