-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: mocking java static method exception - o.mockk.MockKException: No other calls allowed in stdObjectAnswer than equals/hashCode/toString #49
Labels
Projects
Comments
Not able to reproduce with following code:
|
Need definition of |
oleksiyp
changed the title
mocking java static method exception - o.mockk.MockKException: No other calls allowed in stdObjectAnswer than equals/hashCode/toString
Bug: mocking java static method exception - o.mockk.MockKException: No other calls allowed in stdObjectAnswer than equals/hashCode/toString
May 16, 2018
I encounter the same issue with this code on version 1.8.9
|
@nieldw this is not totally same issue. Please open a new ticket. I reproduced only that log4j.Logget is not mockable, but this doesnt match with your statement. Closing original issue as it seems this part of code significantly changed |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sample
running that code leads to MockKException:
objc[29348]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java (0x1042c24c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10434e4e0). One of the two will be used. Which one is undefined.
2018-03-21 12:17:18 DEBUG - [AbstractMockFactory] Creating spyk for MyLog4jExecutor name=#1, moreInterfaces=[]
2018-03-21 12:17:18 DEBUG - [AbstractMockFactory] Creating mockk for Thread name=#2, moreInterfaces=[]
2018-03-21 12:17:19 DEBUG - [AbstractMockFactory] Creating mockk for Runnable name=#3, moreInterfaces=[]
2018-03-21 12:17:19 DEBUG - [JvmStaticMockFactory] Creating static mockk for ThreadContext
2018-03-21 12:17:19 DEBUG - [MockKProxyMaker] Injecting handler to class org.apache.logging.log4j.ThreadContext for static methods
io.mockk.MockKException: No other calls allowed in stdObjectAnswer than equals/hashCode/toString
at io.mockk.impl.stub.MockKStub.stdObjectAnswer(MockKStub.kt:78)
part of my dependencies:
dependencies
The text was updated successfully, but these errors were encountered: