I am trying to display a meaningful failure reason if the returned response is empty. I have tried to do it in the following way:
* def message = offers == "#[_ > 0]" ? 'OK' : 'Empty response'
* match message == 'OK'
The code returns 'Empty response' even if the offers is not empty. If I run separately
* match offers == "#[_ > 0]"
the check passes.
I have two questions:
Why is the expression evaluated to false in the condition?
Is there another way to display failure messages in karate?