Search code examples
javaspringspring-cloud-contract

How to get a response of the previous request with spring-cloud-contract


Let's say I have a scenario that consists of 3 steps:

  • Create an item.
  • Update it by ID.
  • Delete it by ID.

The first step is quite straightforward, I just submit a request and verify response as it's described here

The problem starts with step 2. In order to perform Update and Delete I need to know the ID of the item saved in the step 1. Is there any way with spring-cloud-contracts to extract it from step 1 response?


Solution

  • Not really. However it seems that you're misusing the tool. You're trying to use Spring Cloud Contract for acceptance testing. Why not just set fixed values and verify the semantics?