citrusframework / citrusframework/citrus
Extract is called before validate in http requests
- Dominant language
- Java
- Stars
- 485
- Forks
- 155
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 6
Description
**Citrus Version**
3.4.0
**Expected behavior**
Validate should be called first, otherwise the error message is confusing.
**Actual behavior**
extract is failing before validate is failing
**Test case sample**
First example: is failing because status code is wrong (error message is fine)
```
testRunner.run(http()
.client(myClient)
.send()
.post("/path"))
.message()
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body(new ClassPathResource("whatever.json")));
testRunner.run(http()
.client(myClient)
.receive()
.response(HttpStatus.OK)
.message()
.type(MessageType.JSON);
```
Second example is failing in extract method instead of validate
```
testRunner.run(http()
.client(myClient)
.send()
.post("/path"))
.message()
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.body(new ClassPathResource("whatever.json")));
testRunner.run(http()
.client(myClient)
.receive()
.response(HttpStatus.OK)
.message()
.type(MessageType.JSON)
.extract(JsonPathSupport.jsonPath().expression("$.id", ${myId}"));
```
Contributor guide
Assessment
This issue has not been assessed yet.