I would like to mock the following function:
private fun <T> updateItemInDb(id: Long, column: String, data: T)
which is invoked in the following way by my class:
updateItemInDb(it, DB_POS, i)
, where it
is a Long
, DB_POS
is String
and i
is an Int
.
I want the function to just run without doing anything. I tried the following in my unit test:
1) every { adapter["updateItemInDb"](any<Long>(), any<String>(), any<Int>()) } just Runs
This gives me a type mismatch error: required MockKStubScope<Unit>, found MockKStubScope<Any?>
2) every { adapter["updateItemInDb"](any<Long>(), any<String>(), any<Int>()) } answers { }
This fails at runtime with io.mockk.MockKException: can't find function updateItemInDb(-1078155520644112829, -d008fa83c4f49c0, 843241211) for dynamic call