$(http().client(client).send()
.post("/url")
.message()
.header("Content-Type", "application/json")
.body(new ClassPathResource("citrus/testcase.json")));
$(http()
.client(cwsClient)
.receive()
.response(HttpStatus.BAD_REQUEST)
.message()
.type(MessageType.JSON)
.validate(jsonPath().expression("$.*" , containsString("items[0].state: Destination state can have between 2 and 20 characters.")))
.validate(jsonPath().expression("$.*" , containsString("items[0].recipient: size must be between 1 and 30"))));
This is because the expression key $.* is the same for both validate calls. I suppose to use allOf() and combine the validations into one single validate statement
Citrus Version 3.1.0
Expected behavior All validator shall be called
Actual behavior Only the first is called
Test case sample