CI tests for a municipal permit service call a third-party payment gateway and sometimes charge cards or fail when the vendor is down. How should integration tests be written?
Select an answer to reveal the explanation.
Short Explanation
CI should not swipe real cards to prove a permit fee path. Mock the payment gateway so tests stay fast, safe, and vendor-independent. Live prod credentials and real PANs in fixtures are how audits get exciting for the wrong reasons.
Full Explanation
Integration tests should mock external dependencies that are costly, unsafe, or flaky. For a permit service, stubbing the payment provider keeps pipelines deterministic and prevents accidental charges. Using production credentials, dropping automated tests, or embedding real cardholder data violates both testing and data-handling expectations for civic applications.