Gatling check two values in request body


I want to compare values from response body to decide whether all data are processed. I tried following code but not working.


.check(jsonPath("$.countOfProcessed").is(jsonPath("$.countOfRequested")))


I have also tried this but no luck. Is there any way to manually fail a test  ?

save one and then do jsonPath(…).is(session => session(“first saved”).as[String]) or jsonPath(…).is(jsonPath(…).saveAs.getOrElse(""))