問題文
A Process API orchestrates three System APIs. The team wants a suite that runs on every pull request in the build, finishes in seconds, and does not depend on any backend being available. How should the suite be designed?
選択肢
- Replace each call to a System API with a mocked processor that returns a fixed response, and assert on the payload that the orchestration produces.
- Point each call to a System API at a sandbox deployment of that API, and assert on the payload that the orchestration produces for known input.
- Wrap each call to a System API in a spy that records the request, and assert on the number of calls that the orchestration makes.
- Deploy the Process API to a shared test environment, and assert on the response that a client receives when it calls the deployed endpoint.