First of all, Mockito knows nothing of the constructive language constructs of Kotlin. In the end, Mockito will look in bytecode. Mockito can only understand what he finds there, and what looks like a Java language construct.
Meaning: To be really sure, you can use javap to demonstrate compiled class files to determine the exact names / signatures of the methods you want to make fun of.
And, obviously: when this method is static, you should use PowerMock or JMockit; if not, you should prefer with Mockito.
From a java point of view, you are simply avoiding mocking static things; but, of course, everything becomes really interesting, now that different languages ββwith different ideas / concepts are combined.
source share