Skip to content
Advertisement

Rest assured test failed with error “at java.base/java.util.ArrayList.forEach”

Every time I want to run my test it returns me an error in line that contains RestAssured.given()

I tried different code examples from every where and every time it returns the same error in the same line that contains RestAssured.given()

this is my code

JavaScript

and this is the error returned

JavaScript

Advertisement

Answer

You’re probably using an older version of rest-assured (4.2.0?) which has a dependency on an older version of Groovy (2.5.8) which is not compatible with your JVM version.

To fix this, try upgrading rest-assured to a later version (4.4.0 is the most recent at the time of writing) which is bundled with Groovy 3.0.8, which is a more recent version, and should fix the issue you’re currently facing.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement