How to mockk an extension function on an (external...
# mockk
d
How to mockk an extension function on an (external) java class? I want to mock a following top-level function
Copy code
fun <V : BaseView> EntityViewManager.getById(clazz: Class<out V>, id: Long): V = ...
where
EntityViewManager
is an external java class. Currently, I'm trying to do this
Copy code
mockkStatic("pkg.FileNameKt")
        every { any<EntityViewManager>().getById<InstitutionView>(any(), any()) } returns testInstitutionView()
but the mock isn't used. What am I missing?