Real API workflows depend on prior responses: create a resource, extract its id/token, and use it in the next request. REST Assured enables this by extracting values and passing them forward.
The pattern is extract-then-reuse: capture a value (String token / int id = ...then().extract().path(...)) and feed it into the subsequent request's header, path param, or body. This models end-to-end flows: login → token → protected call; create order → id → get/update/delete order. Keep each step's assertions (status/body) so a failure is localized. For readability, wrap common steps (login) in helper methods or specs. Managing test data across chained calls (and cleaning it up in teardown) is key to reliable, independent workflow tests.
End-to-end order test: POST /orders → extract id → GET /orders/{id} (verify) → DELETE /orders/{id} (cleanup) — each step reusing the id from creation, forming a complete lifecycle test.
You must test: create a user, then verify it via GET by the new id. How do you pass the id between the two REST Assured calls?