Testing and Deployment
What is the primary benefit of replacing an external payment API with a mock API during application testing?
Show the answer
Correct answerB. Testing client behavior with controlled payment responses
AWhy not this: A mock does not contact the production provider, so it cannot establish the provider's availability.
BWhy this is right: Controlled responses let tests exercise client behavior without relying on the external provider.
CWhy not this: A mock's throughput does not represent the real payment provider's processing capacity.
DWhy not this: Infrastructure template validation checks resource definitions rather than client handling of API responses.
A mock API provides controlled responses so developers can test client behavior independently of the payment provider. It does not establish the real provider's availability or performance.