BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
602 / 1048 · Module 13 — MUnit← prev⊞ allnext →

13.16Test Choice branches

Production flow:

Choice

operation == DELETE
   ↓
deactivate-account-subflow

otherwise
   ↓
upsert-account-subflow

You need separate tests.

Test 1
{
  "operation": "DELETE"
}

Verify:

deactivate subflow called
upsert subflow NOT called
Test 2
{
  "operation": "UPSERT"
}

Verify inverse.

This is classic branch coverage.