The longest happy path is the successful scenario that exercises every relevant out-of-process dependency and produces the maximum relevant side effects. Integration testing uses it as the primary workflow, alongside edge cases that unit tests cannot exercise. section 8.3
Apply the technique by:
- Selecting the successful workflow that crosses all out-of-process dependencies. section 8.3
- Identifying the scenario with the greatest relevant side effects. section 8.3
- Testing managed dependencies directly and replacing unmanaged dependencies with mocks when writing an integration test. section 8.3
Changing a corporate email
A CRM integration test changes a user from a corporate to a non-corporate email, updates both user and company records, and verifies the resulting message-bus interaction. section 8.3
Figure 8.6. The use case of changing the user’s email. The controller orchestrates the work between the database, the message bus, and the domain model.
Use the workflow diagram to trace how the controller coordinates the database, message bus, and domain model. section 8.3
