I'd like to mock a string extension.
I've read the instructions how this should be done, by using
mockStatic("kotlin.String")
or
mockkStatic("kotlin.kotlin_builtins")
but it keeps saying
Caused by: io.mockk.MockKException: Can't instantiate proxy for class kotlin.String
at io.mockk.impl.instantiation.JvmMockFactory.newProxy(JvmMockFactory.kt:64)
at io.mockk.impl.instantiation.AbstractMockFactory.newProxy$default(AbstractMockFactory.kt:29)
at io.mockk.impl.instantiation.AbstractMockFactory.spyk(AbstractMockFactory.kt:92)
at io.floriday.pdfgeneratorapi.integration.TradeItemListenerTest.<init>(TradeItemListenerTest.kt:131)
... 18 more
Caused by: io.mockk.proxy.MockKAgentException: Failed to create proxy for class java.lang.String.
class java.lang.String is one of excluded classes
at io.mockk.proxy.jvm.ProxyMaker.throwIfNotPossibleToProxy(ProxyMaker.kt:128)
at io.mockk.proxy.jvm.ProxyMaker.proxy(ProxyMaker.kt:28)
at io.mockk.impl.instantiation.JvmMockFactory.newProxy(JvmMockFactory.kt:34)
... 21 more
Probably I'm mocking the wrong file, but I can't seems to get the filename right to mock. Any help is appreciated :-D