How do you Mockk a Kotlin top level function?

The following syntax has worked to me.

mockkStatic(::sayHello.javaMethod!!.declaringClass.kotlin)

I’m surprised there is nothing on the jvm-stdlib yet for this.

Edit:
This overload has now been introduced officially:
https://github.com/mockk/mockk/pull/518

mockkStatic(::sayHello)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)