Verify a mock was called
Medium70 pts~25 min
- Spies
- Interaction verification
Practice app · Acme REST API
A live REST + GraphQL API with auth, validation, pagination, rate limiting and an interactive request console.
Your starter code already declares BASE_URL — call the API relative to it.
Objective
Use the echo endpoint as a spy and verify exactly what your client sent.
Your task
- 1POST BASE_URL + "/echo" with JSON { "orderId": 1001, "items": [{ "sku": "TQA-100", "qty": 2 }] }.
- 2Assert body.contentType contains "application/json".
- 3Assert body.body deep-equals the payload you sent.
Acceptance criteria
- POST /echo returns 200
- At least 2 assertions pass
Fixtures
- apiKey
- tqa_live_key_123
- basicUser
- admin
- basicPassword
- secret
- username
- qa@target.dev
- password
- Test@123
API testing · API Testing · Mocking & virtualization