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
MockK fails on JDK 17 with Java enums that have constants that are classes #755
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are sure that this issue is important and should not be marked as |
I still think this is a genuine bug that should be fixed at some point. Would it be possible to label it appropriately? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are sure that this issue is important and should not be marked as |
Hi, any updates on this bug? We currently have tests that had to be disabled for this reason. |
Hi, any luck on this issue? @anton-novikov |
Hi, I am also facing a similar issue :/ |
|
So, is there a solution in sight? Got a similar issue here: #1041 |
Having a similar issue! More details here: #1041 (comment) |
Expected Behavior
The test shown below passes
Current Behavior
If you have a Java enum with some of the constants that are classes, MockK won't be able to mock a method that returns such an enum. In particular, the test fails with the following exception
java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the class NestHost, NestMembers, Record, or PermittedSubclasses attribute
Context
Note that when run under JDK 11, the test passes. I believe that this might be related to #473, although I don't think this is exactly the same issue. Also note that Mockito had the same issue before, but they managed to fix it here mockito/mockito#2315
Failure Logs
Stack trace
Minimal reproducible code (the gist of this issue)
The text was updated successfully, but these errors were encountered: