webcompere / system-stubs

System Stubs - Test Doubles for Java System resources
MIT License
91 stars 10 forks source link

junit jupiter >= 5.11.0 throws `java.lang.NoSuchMethodError: 'java.lang.reflect.AccessibleObject` #83

Closed yeikel closed 1 month ago

yeikel commented 1 month ago

Stacktrace:

java.lang.NoSuchMethodError: 'java.lang.reflect.AccessibleObject org.junit.platform.commons.util.ReflectionUtils.makeAccessible(java.lang.reflect.AccessibleObject)' at uk.org.webcompere.systemstubs.jupiter.SystemStubsExtension.setup(SystemStubsExtension.java:86) at uk.org.webcompere.systemstubs.jupiter.SystemStubsExtension.setupFields(SystemStubsExtension.java:110) at uk.org.webcompere.systemstubs.jupiter.SystemStubsExtension.beforeAll(SystemStubsExtension.java:79) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

This issue does not happen with JUnit 5.10.3

ashleyfrieze commented 1 month ago

Looks like a duplicate of #50

I think this was solved in System Stubs 2.0.2, though I'd recommend upgrading to the latest System Stubs if you can.

ashleyfrieze commented 1 month ago

@yeikel - please can you confirm which version of System Stubs you're using?

yeikel commented 1 month ago

@ashleyfrieze I am using an older version but I cannot confirm if the version is the issue. We can close for now

yeikel commented 1 month ago

Please see https://github.com/webcompere/system-stubs/issues/84 if you can