-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
JDK 16 & InaccessibleObjectException #681
Comments
reminding myself 🙏 |
we are facing this issue aswell :( hope this can be fixed soon |
🙏 |
🙏 |
1 similar comment
🙏 |
You can fix this issue on your own. To the java Test-Process, add If you'd have shared your grade config, as required by the issue-template, I could tell you exactly, but as you did not provide it, you'll have to figure out where exactly to add it on your own. This is not a bug in MockK. |
Hi, thanks for this solution, this certainly helped and solved the issue.
Maybe add it to readme/docs, so others can easily resolve this as well. |
I don't see the necessity of putting a JDK behavior into the mockK docks. This change of behavior is well documented at the JVM itself and a google-search for The issue is caused by application logic and not by mockk. |
@timkante apologies, but could you maybe give a little bit more context on how to fix this? we have added the mentioned argument in our gradle.properties file as a vm argument, but are still facing this issue.. |
tasks.test {
…
// https://github.com/mockk/mockk/issues/681
jvmArgs("--add-opens", "java.base/java.time=ALL-UNNAMED")
} |
I think this problem and workaround/solution should be stated in docs, because it's a common obstacle for JDK 16+ users. Also, here is config for maven users: <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
--add-opens java.base/java.time=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED <!-- handy for spying spring proxies -->
</argLine>
</configuration>
</plugin> |
Right @sergey-volkov-lm, makes sense. Would you please open a PR to add it to the docs? 🙏 |
Expected Behavior
I upgraded to JDK16 & Gradle 7 and I have issues when running mockk:
Will fail with:
(see full stacktrace below)
Current Behavior
We currently use JDK11 where this works correctly.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Full stacktrace
The text was updated successfully, but these errors were encountered: