BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
49 / 81 · Module 14 — External Automated Testing of Mule Integrations · filtered: interview← prev⊞ allnext →

14.12Cleanup must not hide failures

Bad:

await create();
await verify();
await delete();

If verification throws:

delete never runs

Use fixture/finally cleanup where appropriate.

Conceptually:

try {
   ...
} finally {
   await cleanup();
}

But be cautious: when a test fails, keeping the record temporarily may help debugging.