Echo

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.

Echo / shop-api Design preview
Recording

Payment service

checkout / authorised-card
  1. GET /v1/methods 200
  2. POST /v1/authorisations 201
  3. GET /v1/authorisations/pay_14 200
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" }
Inspect the request and response that define one provider interaction.

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.

Echo / shop-api Design preview
Scenario override

First attempt times out

Simulation
payments / rev. 03
Match
method + path + body
Subsequent calls
Recorded response
  1. +0 ms Receive request POST /v1/authorisations Matched
  2. +800 ms Hold response Client deadline reached Timeout
  3. +1,000 ms Receive retry Same idempotency key Matched
  4. +1,024 ms Return recording 201 Created · pay_14 Replayed
The scenario keeps attempt order and delay together for the next replay.
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.

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