What does it mean?
Integration testing checks how components or systems work together. A mocked response can validate consumer behavior, but it is not proof that the real dependency accepts the request, applies its rules, or completes the end-to-end action.
Name the boundary and the expected transition
Identify the producer, consumer, exchanged data, authentication, and the final state expected by users or operations. Record schema and mapping rules, such as amount units, time zones, identifiers, and optional fields. Agreement at the boundary prevents a valid-looking response from hiding a meaning mismatch.
Choose controlled and real-dependency evidence deliberately
Use fixtures or stubs for repeatable consumer error checks, and an approved sandbox for supported real integration scenarios. Label results by method. A contract check against a local stub does not establish connectivity, credentials, rate limits, or provider behavior. Real sandboxes also have limitations; document differences from the intended production configuration.
Observe asynchronous outcomes and failures
Many integrations acknowledge a request before the final work finishes. Check completion through an appropriate event or state observation with a bounded timeout, not an arbitrary delay. Exercise agreed duplicate, rejected, delayed, and unavailable cases. Verify retry and compensation behavior against the contract; do not assume all actions can be safely retried.
Order creation after a payment callback
A payment provider sends a sandbox callback, and the application should create exactly one order for the agreed transaction identifier.
- Define the callback payload, signature setup, and accepted duplicate behavior.
- Use a controlled fixture to check malformed and rejected callbacks.
- Use approved sandbox access to validate the supported provider flow.
- Observe the resulting order within the agreed deadline and record which evidence used a real dependency.
- Resend the callback only where authorized and verify the documented duplicate behavior.
Illustrative scenario, not a customer result or a universal coverage promise.
Practical checklist
- Producer, consumer, contract, and final observable state.
- Field mappings, units, identifiers, and access requirements.
- Separate fixture, contract, and real-dependency evidence.
- Bounded completion checks, failure paths, and cleanup ownership.
Sources and further reading
Use the linked technical documentation for current framework details. Adapt these practices to your product requirements and approved environment scope.