REST Assured is currently at version 4.3.x spring default is 3.3. Rest Assured 3.3 uses an older version groovy that generates warning from Java 11 about illegal access that will be discounted in a future JDK version. REST assured 4.3 upgrades groovy to 3.0.3 which fixes these JDK compatibility issues. Please consider adding support for the 4.x series of REST Assured. This might depend on
- Issue Spring Rest Docs ticket to support RestAssured 4
- Issue Spring Boot Upgrade to Groovy 3.0.0 #20119
Comment From: wilkinsona
Thanks, @asaikali. FWIW, the version of Groovy that REST Assured shouldn't matter as it'll be overridden by Spring Boot's dependency management. As far as we know, the 2.5.x version of Groovy that Spring Boot uses by default works fine on Java 11.
Comment From: asaikali
It's working just fine on Java 11 I just see a lot the warning below in my logs.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/adib/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.5.12/c5a65ece40ef0030e6958af990bd6d83b4e206ec/groovy-2.5.12.jar) to method java.lang.reflect.AnnotatedElement.lambda$getDeclaredAnnotationsByType$0(java.lang.annotation.Annotation,java.lang.annotation.Annotation)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Comment From: asaikali
FYI I don't use groovy in my app, I am on boot 2.3. I have been able to override the boot defaults to Groovy 3.0.4 and RestAssured 4.3.1 everything seems to be working fine all my tests are passing. RestDocs looks like it's working on with RestAssured 4.3.1
Comment From: hennr
Hi @philwebb ,
can you give us a idea why you put this ticket into blocked? Thanks in advance!
Comment From: wilkinsona
@hennr I believe the comments above yours answer that question. The big one is that REST Assured 4.3 uses Groovy 3.0.x while Boot is still using Groovy 2.5.x at this time. The upgrade to Groovy 3.0 is blocked as there is no Groovy 3.0-compatible GA of Spock at this time.
Comment From: chadlwilson
Is it a possibility for us to get to rest-assured 4.2
earlier than 4.3
to reduce the delta we are running with? We have been running locally with 4.2
dependency overrides (no Groovy change) without noticing any issues. Haven't run it through all the boot regression suites; so treat as anecdotal.
I believe it might be possible to decouple broad4.x
compatibility from 4.3
compatibility (which does indeed involve the aforementioned Groovy upgrade issues)
Comment From: hennr
@hennr I believe the comments above yours answer that question. The big one is that REST Assured 4.3 uses Groovy 3.0.x while Boot is still using Groovy 2.5.x at this time. The upgrade to Groovy 3.0 is blocked as there is no Groovy 3.0-compatible GA of Spock at this time.
Thanks for clarifiying this, @wilkinsona
Is it a possibility for us to get to rest-assured 4.2 earlier than 4.3 to reduce the delta we are running with? We have been running locally with 4.2 dependency overrides (no Groovy change) without noticing any issues. Haven't run it through all the boot regression suites; so treat as anecdotal. I believe it might be possible to decouple broad4.x compatibility from 4.3 compatibility (which does indeed involve the aforementioned Groovy upgrade issues)
I like this suggestion by @chadlwilson a lot, is there a chance to go this way?
Comment From: wilkinsona
Yes, I think so. Spring REST Docs is compatible with REST Assured 4.x so it's just the Groovy dependency that's holding this back. 4.2.0 uses Groovy 2.5.x so we should be able to upgrade to that in Boot 2.5.
Comment From: hennr
That's good news, thanks everyone!
Comment From: wilkinsona
Superseded by https://github.com/spring-projects/spring-boot/issues/24962.