citrusframework / citrusframework/citrus

Only one Validator is called in receive response

Open
#814 1 comment 0 reactions 0 assignees View on GitHub
question to-discuss
Dominant language
Java
Stars
485
Forks
155
Avg merge
4d 22h
Merged PRs (30d)
6

Description

**Citrus Version**
3.1.0

**Expected behavior**
All validator shall be called

**Actual behavior**
Only the first is called

**Test case sample**

```
$(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"))));
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the HTTP send/receive sample in the report, focusing on response validation and chained validate calls. Trace the receive-response validation entry point and add or update a regression test showing that both JSONPath validators are called; done means all validators run and both expected messages are checked.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.