I'm trying to migrate a project to build on JDK17 and in that project we use groovy and spock for testing. It seems that groovy 3.* has a problem with reflection access to JDK especially visible when using closures
A simple test class:
.negate() being a default method in a Predicate interface which a part of the jdk
The following however works:
I'm using JDK 17.0.1 Corretto for my tests and the example minimal project can be found here:
The above code works with groovy 4.0.0-beta-2. Spock does not support groovy 4 at this moment, so upgrading groovy to 4 isn't an option for me and it seems to only be a beta release at the moment.
I've tried adding jvm args
however that does not seem to affect the output