I have a scenario in Gatling and I want to check if the response body value maps to an error string. The response is a 400:
{"error": "ERROR_1"}
The check is failing with a compilation error:
http("Some Request")
.put("/endpoint")
.asJson
.check(jsonPath("$.error") == "ERROR_1")
.check(status.is(400))
Also tried saving the error as a variable
.check(jsonPath("$.error").saveAs("error"))
.check("${error}" == "ERROR_1")
And realised the .check("${error}".is("ERROR_1"))
won't work either since .is only works for ints. The gatling docs don't explain expressions too much either https://gatling.io/docs/current/http/http_check#validating
Any ideas?