Control the services you depend on.
Give an external service a repeatable part to play, from the first successful request to the timeout on a retry.
Recording
Payment service
checkout / authorised-card - GET
/v1/methods200 - POST
/v1/authorisations201 - GET
/v1/authorisations/pay_14200
Match policy
strict sequence Interaction 02 201 Created
POST /v1/authorisations
Request body
{
"order_id": "ord_1014",
"amount_minor": 5759
} Recorded response
{ "id": "pay_14", "status": "authorised" } A provider sandbox can change between two builds. A recorded exchange gives both builds the same dependency, down to the delay before its response.
Rehearse the retry.
A useful simulation includes the wait. Specify which attempt times out, when the provider recovers and which response follows.
Scenario override
First attempt times out
- Simulation
- payments / rev. 03
- Match
- method + path + body
- Subsequent calls
- Recorded response
-
+0 msReceive request POST /v1/authorisations Matched -
+800 msHold response Client deadline reached Timeout -
+1,000 msReceive retry Same idempotency key Matched -
+1,024 msReturn recording 201 Created · pay_14 Replayed
- Capture boundary
- Record the fields that determine a match, such as method, path and currency. Exclude credentials before preserving a recording.
- Scenario selection
- Give the happy path and the timeout separate names so a test can select its dependency behaviour explicitly.
- Replay evidence
- An unmatched request deserves its own result. A fallback success would let the test exercise a different contract.
In the same workflow
How Echo fits into the planned x1991 workspace.
Availability
In development
Release history
Echo is in development. The interfaces use illustrative data. A public release date has yet to be announced.
Read the Echo concept guide