agentic-qe 3.7.9 → 3.7.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/.claude/skills/.validation/README.md +111 -111
  2. package/.claude/skills/.validation/examples/chaos-engineering-output.example.json +530 -530
  3. package/.claude/skills/.validation/examples/performance-testing-output.example.json +252 -252
  4. package/.claude/skills/.validation/examples/security-testing-output.example.json +413 -413
  5. package/.claude/skills/.validation/examples/testability-scoring-output.example.json +350 -350
  6. package/.claude/skills/.validation/schemas/skill-eval.schema.json +462 -462
  7. package/.claude/skills/.validation/schemas/skill-frontmatter.schema.json +341 -341
  8. package/.claude/skills/.validation/schemas/skill-output-meta.schema.json +199 -199
  9. package/.claude/skills/.validation/schemas/skill-output.template.json +610 -610
  10. package/.claude/skills/.validation/skill-validation-mcp-integration.md +250 -250
  11. package/.claude/skills/.validation/templates/eval.template.yaml +366 -366
  12. package/.claude/skills/.validation/templates/schemas/output.json +145 -145
  13. package/.claude/skills/.validation/templates/security-testing-eval.template.yaml +725 -725
  14. package/.claude/skills/.validation/templates/skill-frontmatter.example.yaml +225 -225
  15. package/.claude/skills/.validation/test-data/invalid-output.json +5 -5
  16. package/.claude/skills/.validation/test-data/minimal-output.json +9 -9
  17. package/.claude/skills/.validation/test-data/sample-output.json +73 -73
  18. package/.claude/skills/a11y-ally/evals/a11y-ally.yaml +376 -376
  19. package/.claude/skills/a11y-ally/schemas/output.json +549 -549
  20. package/.claude/skills/accessibility-testing/evals/accessibility-testing.yaml +719 -719
  21. package/.claude/skills/accessibility-testing/schemas/output.json +776 -776
  22. package/.claude/skills/accessibility-testing/test-data/sample-output.json +191 -191
  23. package/.claude/skills/agentic-quality-engineering/schemas/output.json +577 -577
  24. package/.claude/skills/api-testing-patterns/evals/api-testing-patterns.yaml +696 -696
  25. package/.claude/skills/api-testing-patterns/schemas/output.json +845 -845
  26. package/.claude/skills/aqe-v2-v3-migration/schemas/output.json +513 -513
  27. package/.claude/skills/brutal-honesty-review/schemas/output.json +291 -291
  28. package/.claude/skills/bug-reporting-excellence/schemas/output.json +288 -288
  29. package/.claude/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +761 -761
  30. package/.claude/skills/chaos-engineering-resilience/schemas/output.json +1205 -1205
  31. package/.claude/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +157 -157
  32. package/.claude/skills/cicd-pipeline-qe-orchestrator/schemas/output.json +542 -542
  33. package/.claude/skills/code-review-quality/schemas/output.json +264 -264
  34. package/.claude/skills/compatibility-testing/evals/compatibility-testing.yaml +410 -410
  35. package/.claude/skills/compatibility-testing/schemas/output.json +551 -551
  36. package/.claude/skills/compliance-testing/evals/compliance-testing.yaml +1107 -1107
  37. package/.claude/skills/compliance-testing/schemas/output.json +845 -845
  38. package/.claude/skills/consultancy-practices/schemas/output.json +282 -282
  39. package/.claude/skills/contract-testing/evals/contract-testing.yaml +748 -748
  40. package/.claude/skills/contract-testing/schemas/output.json +638 -638
  41. package/.claude/skills/database-testing/evals/database-testing.yaml +968 -968
  42. package/.claude/skills/database-testing/schemas/output.json +1446 -1446
  43. package/.claude/skills/debug-loop/SKILL.md +61 -61
  44. package/.claude/skills/enterprise-integration-testing/SKILL.md +735 -735
  45. package/.claude/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +158 -158
  46. package/.claude/skills/enterprise-integration-testing/schemas/output.json +74 -74
  47. package/.claude/skills/enterprise-integration-testing/scripts/validate-config.json +25 -25
  48. package/.claude/skills/iterative-loop/SKILL.md +371 -371
  49. package/.claude/skills/localization-testing/evals/localization-testing.yaml +544 -544
  50. package/.claude/skills/localization-testing/schemas/output.json +325 -325
  51. package/.claude/skills/middleware-testing-patterns/SKILL.md +798 -798
  52. package/.claude/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +153 -153
  53. package/.claude/skills/middleware-testing-patterns/schemas/output.json +58 -58
  54. package/.claude/skills/middleware-testing-patterns/scripts/validate-config.json +25 -25
  55. package/.claude/skills/mobile-testing/evals/mobile-testing.yaml +537 -537
  56. package/.claude/skills/mobile-testing/schemas/output.json +318 -318
  57. package/.claude/skills/mutation-testing/evals/mutation-testing.yaml +652 -652
  58. package/.claude/skills/mutation-testing/schemas/output.json +707 -707
  59. package/.claude/skills/mutation-testing/test-data/sample-output.json +295 -295
  60. package/.claude/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +450 -450
  61. package/.claude/skills/n8n-expression-testing/schemas/output.json +369 -369
  62. package/.claude/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +522 -522
  63. package/.claude/skills/n8n-integration-testing-patterns/schemas/output.json +291 -291
  64. package/.claude/skills/n8n-security-testing/evals/n8n-security-testing.yaml +493 -493
  65. package/.claude/skills/n8n-security-testing/schemas/output.json +293 -293
  66. package/.claude/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +500 -500
  67. package/.claude/skills/n8n-trigger-testing-strategies/schemas/output.json +295 -295
  68. package/.claude/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +497 -497
  69. package/.claude/skills/n8n-workflow-testing-fundamentals/schemas/output.json +254 -254
  70. package/.claude/skills/observability-testing-patterns/SKILL.md +930 -930
  71. package/.claude/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +157 -157
  72. package/.claude/skills/observability-testing-patterns/schemas/output.json +58 -58
  73. package/.claude/skills/observability-testing-patterns/scripts/validate-config.json +25 -25
  74. package/.claude/skills/pentest-validation/SKILL.md +268 -268
  75. package/.claude/skills/pentest-validation/evals/pentest-validation.yaml +708 -708
  76. package/.claude/skills/pentest-validation/schemas/output.json +281 -281
  77. package/.claude/skills/performance-analysis/evals/performance-analysis.yaml +144 -144
  78. package/.claude/skills/performance-analysis/schemas/output.json +588 -588
  79. package/.claude/skills/performance-testing/evals/performance-testing.yaml +772 -772
  80. package/.claude/skills/performance-testing/schemas/output.json +1184 -1184
  81. package/.claude/skills/pr-review/SKILL.md +61 -61
  82. package/.claude/skills/qcsd-cicd-swarm/SKILL.md +2206 -2206
  83. package/.claude/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +211 -211
  84. package/.claude/skills/qcsd-cicd-swarm/schemas/output.json +86 -86
  85. package/.claude/skills/qcsd-cicd-swarm/scripts/validate-config.json +30 -30
  86. package/.claude/skills/qcsd-development-swarm/SKILL.md +2154 -2154
  87. package/.claude/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +162 -162
  88. package/.claude/skills/qcsd-development-swarm/schemas/output.json +72 -72
  89. package/.claude/skills/qcsd-development-swarm/scripts/validate-config.json +25 -25
  90. package/.claude/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +138 -138
  91. package/.claude/skills/qcsd-ideation-swarm/schemas/output.json +568 -568
  92. package/.claude/skills/qcsd-production-swarm/SKILL.md +2781 -2781
  93. package/.claude/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +246 -246
  94. package/.claude/skills/qcsd-production-swarm/schemas/output.json +505 -505
  95. package/.claude/skills/qcsd-production-swarm/scripts/validate-config.json +25 -25
  96. package/.claude/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +443 -443
  97. package/.claude/skills/qe-chaos-resilience/schemas/output.json +314 -314
  98. package/.claude/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +459 -459
  99. package/.claude/skills/qe-code-intelligence/schemas/output.json +315 -315
  100. package/.claude/skills/qe-contract-testing/evals/qe-contract-testing.yaml +513 -513
  101. package/.claude/skills/qe-contract-testing/schemas/output.json +295 -295
  102. package/.claude/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +494 -494
  103. package/.claude/skills/qe-coverage-analysis/schemas/output.json +286 -286
  104. package/.claude/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +511 -511
  105. package/.claude/skills/qe-defect-intelligence/schemas/output.json +283 -283
  106. package/.claude/skills/qe-iterative-loop/schemas/output.json +264 -264
  107. package/.claude/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +144 -144
  108. package/.claude/skills/qe-learning-optimization/schemas/output.json +288 -288
  109. package/.claude/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +506 -506
  110. package/.claude/skills/qe-quality-assessment/schemas/output.json +550 -550
  111. package/.claude/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +598 -598
  112. package/.claude/skills/qe-requirements-validation/schemas/output.json +587 -587
  113. package/.claude/skills/qe-security-compliance/evals/qe-security-compliance.yaml +595 -595
  114. package/.claude/skills/qe-security-compliance/schemas/output.json +498 -498
  115. package/.claude/skills/qe-test-execution/evals/qe-test-execution.yaml +607 -607
  116. package/.claude/skills/qe-test-execution/schemas/output.json +529 -529
  117. package/.claude/skills/qe-test-generation/evals/qe-test-generation.yaml +148 -148
  118. package/.claude/skills/qe-test-generation/schemas/output.json +439 -439
  119. package/.claude/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +142 -142
  120. package/.claude/skills/qe-visual-accessibility/schemas/output.json +491 -491
  121. package/.claude/skills/quality-metrics/evals/quality-metrics.yaml +494 -494
  122. package/.claude/skills/quality-metrics/schemas/output.json +403 -403
  123. package/.claude/skills/refactoring-patterns/schemas/output.json +475 -475
  124. package/.claude/skills/regression-testing/evals/regression-testing.yaml +504 -504
  125. package/.claude/skills/regression-testing/schemas/output.json +311 -311
  126. package/.claude/skills/release/SKILL.md +347 -347
  127. package/.claude/skills/risk-based-testing/evals/risk-based-testing.yaml +141 -141
  128. package/.claude/skills/risk-based-testing/schemas/output.json +480 -480
  129. package/.claude/skills/security-testing/evals/security-testing.yaml +789 -789
  130. package/.claude/skills/security-testing/schemas/output.json +879 -879
  131. package/.claude/skills/security-visual-testing/evals/security-visual-testing.yaml +163 -163
  132. package/.claude/skills/security-visual-testing/schemas/output.json +486 -486
  133. package/.claude/skills/sfdipot-product-factors/SKILL.md +239 -239
  134. package/.claude/skills/sherlock-review/schemas/output.json +297 -297
  135. package/.claude/skills/shift-left-testing/evals/shift-left-testing.yaml +145 -145
  136. package/.claude/skills/shift-left-testing/schemas/output.json +459 -459
  137. package/.claude/skills/shift-right-testing/evals/shift-right-testing.yaml +147 -147
  138. package/.claude/skills/shift-right-testing/schemas/output.json +418 -418
  139. package/.claude/skills/skills-manifest.json +1 -1
  140. package/.claude/skills/tdd-london-chicago/schemas/output.json +444 -444
  141. package/.claude/skills/technical-writing/schemas/output.json +268 -268
  142. package/.claude/skills/test-automation-strategy/evals/test-automation-strategy.yaml +148 -148
  143. package/.claude/skills/test-automation-strategy/schemas/output.json +444 -444
  144. package/.claude/skills/test-data-management/evals/test-data-management.yaml +504 -504
  145. package/.claude/skills/test-data-management/schemas/output.json +284 -284
  146. package/.claude/skills/test-design-techniques/evals/test-design-techniques.yaml +142 -142
  147. package/.claude/skills/test-design-techniques/schemas/output.json +295 -295
  148. package/.claude/skills/test-environment-management/schemas/output.json +310 -310
  149. package/.claude/skills/test-idea-rewriting/SKILL.md +229 -229
  150. package/.claude/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +155 -155
  151. package/.claude/skills/test-reporting-analytics/schemas/output.json +329 -329
  152. package/.claude/skills/testability-scoring/evals/testability-scoring.yaml +814 -814
  153. package/.claude/skills/testability-scoring/resources/templates/config.template.js +84 -84
  154. package/.claude/skills/testability-scoring/schemas/output.json +606 -606
  155. package/.claude/skills/testability-scoring/scripts/generate-html-report.js +1007 -1007
  156. package/.claude/skills/verification-quality/evals/verification-quality.yaml +150 -150
  157. package/.claude/skills/verification-quality/schemas/output.json +432 -432
  158. package/.claude/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +154 -154
  159. package/.claude/skills/visual-testing-advanced/schemas/output.json +294 -294
  160. package/.claude/skills/wms-testing-patterns/evals/wms-testing-patterns.yaml +165 -165
  161. package/.claude/skills/wms-testing-patterns/schemas/output.json +150 -150
  162. package/.claude/skills/wms-testing-patterns/scripts/validate-config.json +51 -51
  163. package/CHANGELOG.md +14 -0
  164. package/README.md +169 -900
  165. package/assets/agents/v3/helpers/quality-criteria/evidence-classification.md +116 -116
  166. package/assets/agents/v3/helpers/quality-criteria/htsm-categories.md +139 -139
  167. package/assets/governance/constitution.md +202 -202
  168. package/assets/governance/shards/chaos-resilience.shard.md +221 -221
  169. package/assets/governance/shards/code-intelligence.shard.md +178 -178
  170. package/assets/governance/shards/contract-testing.shard.md +206 -206
  171. package/assets/governance/shards/coverage-analysis.shard.md +146 -146
  172. package/assets/governance/shards/defect-intelligence.shard.md +182 -182
  173. package/assets/governance/shards/learning-optimization.shard.md +248 -248
  174. package/assets/governance/shards/quality-assessment.shard.md +165 -165
  175. package/assets/governance/shards/requirements-validation.shard.md +177 -177
  176. package/assets/governance/shards/security-compliance.shard.md +196 -196
  177. package/assets/governance/shards/test-execution.shard.md +156 -156
  178. package/assets/governance/shards/test-generation.shard.md +128 -128
  179. package/assets/governance/shards/visual-accessibility.shard.md +209 -209
  180. package/assets/hooks/cross-phase-memory.yaml +253 -253
  181. package/assets/patterns/adr-051-booster-patterns.json +78 -78
  182. package/assets/patterns/adr-051-embedding-patterns.json +147 -147
  183. package/assets/patterns/adr-051-integration-summary.json +62 -62
  184. package/assets/patterns/adr-051-reasoning-patterns.json +166 -166
  185. package/assets/patterns/adr-051-router-patterns.json +113 -113
  186. package/assets/patterns/index.json +136 -136
  187. package/assets/skills/.validation/README.md +111 -111
  188. package/assets/skills/.validation/examples/chaos-engineering-output.example.json +530 -530
  189. package/assets/skills/.validation/examples/performance-testing-output.example.json +252 -252
  190. package/assets/skills/.validation/examples/security-testing-output.example.json +413 -413
  191. package/assets/skills/.validation/examples/testability-scoring-output.example.json +350 -350
  192. package/assets/skills/.validation/schemas/skill-eval.schema.json +462 -462
  193. package/assets/skills/.validation/schemas/skill-frontmatter.schema.json +341 -341
  194. package/assets/skills/.validation/schemas/skill-output-meta.schema.json +199 -199
  195. package/assets/skills/.validation/schemas/skill-output.template.json +610 -610
  196. package/assets/skills/.validation/skill-validation-mcp-integration.md +250 -250
  197. package/assets/skills/.validation/templates/eval.template.yaml +366 -366
  198. package/assets/skills/.validation/templates/schemas/output.json +145 -145
  199. package/assets/skills/.validation/templates/security-testing-eval.template.yaml +725 -725
  200. package/assets/skills/.validation/templates/skill-frontmatter.example.yaml +225 -225
  201. package/assets/skills/.validation/test-data/invalid-output.json +5 -5
  202. package/assets/skills/.validation/test-data/minimal-output.json +9 -9
  203. package/assets/skills/.validation/test-data/sample-output.json +73 -73
  204. package/assets/skills/a11y-ally/evals/a11y-ally.yaml +376 -376
  205. package/assets/skills/a11y-ally/schemas/output.json +549 -549
  206. package/assets/skills/accessibility-testing/evals/accessibility-testing.yaml +719 -719
  207. package/assets/skills/accessibility-testing/schemas/output.json +776 -776
  208. package/assets/skills/accessibility-testing/test-data/sample-output.json +191 -191
  209. package/assets/skills/agentic-quality-engineering/schemas/output.json +577 -577
  210. package/assets/skills/api-testing-patterns/evals/api-testing-patterns.yaml +696 -696
  211. package/assets/skills/api-testing-patterns/schemas/output.json +845 -845
  212. package/assets/skills/aqe-v2-v3-migration/schemas/output.json +513 -513
  213. package/assets/skills/brutal-honesty-review/schemas/output.json +291 -291
  214. package/assets/skills/bug-reporting-excellence/schemas/output.json +288 -288
  215. package/assets/skills/chaos-engineering-resilience/evals/chaos-engineering-resilience.yaml +761 -761
  216. package/assets/skills/chaos-engineering-resilience/schemas/output.json +1205 -1205
  217. package/assets/skills/cicd-pipeline-qe-orchestrator/evals/cicd-pipeline-qe-orchestrator.yaml +157 -157
  218. package/assets/skills/cicd-pipeline-qe-orchestrator/schemas/output.json +542 -542
  219. package/assets/skills/code-review-quality/schemas/output.json +264 -264
  220. package/assets/skills/compatibility-testing/evals/compatibility-testing.yaml +410 -410
  221. package/assets/skills/compatibility-testing/schemas/output.json +551 -551
  222. package/assets/skills/compliance-testing/evals/compliance-testing.yaml +1107 -1107
  223. package/assets/skills/compliance-testing/schemas/output.json +845 -845
  224. package/assets/skills/consultancy-practices/schemas/output.json +282 -282
  225. package/assets/skills/contract-testing/evals/contract-testing.yaml +748 -748
  226. package/assets/skills/contract-testing/schemas/output.json +638 -638
  227. package/assets/skills/database-testing/evals/database-testing.yaml +968 -968
  228. package/assets/skills/database-testing/schemas/output.json +1446 -1446
  229. package/assets/skills/debug-loop/SKILL.md +61 -61
  230. package/assets/skills/enterprise-integration-testing/SKILL.md +735 -735
  231. package/assets/skills/enterprise-integration-testing/evals/enterprise-integration-testing.yaml +158 -158
  232. package/assets/skills/enterprise-integration-testing/schemas/output.json +74 -74
  233. package/assets/skills/enterprise-integration-testing/scripts/validate-config.json +25 -25
  234. package/assets/skills/localization-testing/evals/localization-testing.yaml +544 -544
  235. package/assets/skills/localization-testing/schemas/output.json +325 -325
  236. package/assets/skills/middleware-testing-patterns/SKILL.md +798 -798
  237. package/assets/skills/middleware-testing-patterns/evals/middleware-testing-patterns.yaml +153 -153
  238. package/assets/skills/middleware-testing-patterns/schemas/output.json +58 -58
  239. package/assets/skills/middleware-testing-patterns/scripts/validate-config.json +25 -25
  240. package/assets/skills/mobile-testing/evals/mobile-testing.yaml +537 -537
  241. package/assets/skills/mobile-testing/schemas/output.json +318 -318
  242. package/assets/skills/mutation-testing/evals/mutation-testing.yaml +652 -652
  243. package/assets/skills/mutation-testing/schemas/output.json +707 -707
  244. package/assets/skills/mutation-testing/test-data/sample-output.json +295 -295
  245. package/assets/skills/n8n-expression-testing/evals/n8n-expression-testing.yaml +450 -450
  246. package/assets/skills/n8n-expression-testing/schemas/output.json +369 -369
  247. package/assets/skills/n8n-integration-testing-patterns/evals/n8n-integration-testing-patterns.yaml +522 -522
  248. package/assets/skills/n8n-integration-testing-patterns/schemas/output.json +291 -291
  249. package/assets/skills/n8n-security-testing/evals/n8n-security-testing.yaml +493 -493
  250. package/assets/skills/n8n-security-testing/schemas/output.json +293 -293
  251. package/assets/skills/n8n-trigger-testing-strategies/evals/n8n-trigger-testing-strategies.yaml +500 -500
  252. package/assets/skills/n8n-trigger-testing-strategies/schemas/output.json +295 -295
  253. package/assets/skills/n8n-workflow-testing-fundamentals/evals/n8n-workflow-testing-fundamentals.yaml +497 -497
  254. package/assets/skills/n8n-workflow-testing-fundamentals/schemas/output.json +254 -254
  255. package/assets/skills/observability-testing-patterns/SKILL.md +930 -930
  256. package/assets/skills/observability-testing-patterns/evals/observability-testing-patterns.yaml +157 -157
  257. package/assets/skills/observability-testing-patterns/schemas/output.json +58 -58
  258. package/assets/skills/observability-testing-patterns/scripts/validate-config.json +25 -25
  259. package/assets/skills/pentest-validation/SKILL.md +268 -268
  260. package/assets/skills/pentest-validation/evals/pentest-validation.yaml +708 -708
  261. package/assets/skills/pentest-validation/schemas/output.json +281 -281
  262. package/assets/skills/performance-testing/evals/performance-testing.yaml +772 -772
  263. package/assets/skills/performance-testing/schemas/output.json +1184 -1184
  264. package/assets/skills/pr-review/SKILL.md +61 -61
  265. package/assets/skills/qcsd-cicd-swarm/SKILL.md +2206 -2206
  266. package/assets/skills/qcsd-cicd-swarm/evals/qcsd-cicd-swarm.yaml +211 -211
  267. package/assets/skills/qcsd-cicd-swarm/schemas/output.json +86 -86
  268. package/assets/skills/qcsd-cicd-swarm/scripts/validate-config.json +30 -30
  269. package/assets/skills/qcsd-development-swarm/SKILL.md +2154 -2154
  270. package/assets/skills/qcsd-development-swarm/evals/qcsd-development-swarm.yaml +162 -162
  271. package/assets/skills/qcsd-development-swarm/schemas/output.json +72 -72
  272. package/assets/skills/qcsd-development-swarm/scripts/validate-config.json +25 -25
  273. package/assets/skills/qcsd-ideation-swarm/evals/qcsd-ideation-swarm.yaml +138 -138
  274. package/assets/skills/qcsd-ideation-swarm/schemas/output.json +568 -568
  275. package/assets/skills/qcsd-production-swarm/SKILL.md +2781 -2781
  276. package/assets/skills/qcsd-production-swarm/evals/qcsd-production-swarm.yaml +246 -246
  277. package/assets/skills/qcsd-production-swarm/schemas/output.json +505 -505
  278. package/assets/skills/qcsd-production-swarm/scripts/validate-config.json +25 -25
  279. package/assets/skills/qe-chaos-resilience/evals/qe-chaos-resilience.yaml +443 -443
  280. package/assets/skills/qe-chaos-resilience/schemas/output.json +314 -314
  281. package/assets/skills/qe-code-intelligence/evals/qe-code-intelligence.yaml +459 -459
  282. package/assets/skills/qe-code-intelligence/schemas/output.json +315 -315
  283. package/assets/skills/qe-contract-testing/evals/qe-contract-testing.yaml +513 -513
  284. package/assets/skills/qe-contract-testing/schemas/output.json +295 -295
  285. package/assets/skills/qe-coverage-analysis/evals/qe-coverage-analysis.yaml +494 -494
  286. package/assets/skills/qe-coverage-analysis/schemas/output.json +286 -286
  287. package/assets/skills/qe-defect-intelligence/evals/qe-defect-intelligence.yaml +511 -511
  288. package/assets/skills/qe-defect-intelligence/schemas/output.json +283 -283
  289. package/assets/skills/qe-iterative-loop/schemas/output.json +264 -264
  290. package/assets/skills/qe-learning-optimization/evals/qe-learning-optimization.yaml +144 -144
  291. package/assets/skills/qe-learning-optimization/schemas/output.json +288 -288
  292. package/assets/skills/qe-quality-assessment/evals/qe-quality-assessment.yaml +506 -506
  293. package/assets/skills/qe-quality-assessment/schemas/output.json +550 -550
  294. package/assets/skills/qe-requirements-validation/evals/qe-requirements-validation.yaml +598 -598
  295. package/assets/skills/qe-requirements-validation/schemas/output.json +587 -587
  296. package/assets/skills/qe-security-compliance/evals/qe-security-compliance.yaml +595 -595
  297. package/assets/skills/qe-security-compliance/schemas/output.json +498 -498
  298. package/assets/skills/qe-test-execution/evals/qe-test-execution.yaml +607 -607
  299. package/assets/skills/qe-test-execution/schemas/output.json +529 -529
  300. package/assets/skills/qe-test-generation/evals/qe-test-generation.yaml +148 -148
  301. package/assets/skills/qe-test-generation/schemas/output.json +439 -439
  302. package/assets/skills/qe-visual-accessibility/evals/qe-visual-accessibility.yaml +142 -142
  303. package/assets/skills/qe-visual-accessibility/schemas/output.json +491 -491
  304. package/assets/skills/quality-metrics/evals/quality-metrics.yaml +494 -494
  305. package/assets/skills/quality-metrics/schemas/output.json +403 -403
  306. package/assets/skills/refactoring-patterns/schemas/output.json +475 -475
  307. package/assets/skills/regression-testing/evals/regression-testing.yaml +504 -504
  308. package/assets/skills/regression-testing/schemas/output.json +311 -311
  309. package/assets/skills/risk-based-testing/evals/risk-based-testing.yaml +141 -141
  310. package/assets/skills/risk-based-testing/schemas/output.json +480 -480
  311. package/assets/skills/security-testing/evals/security-testing.yaml +789 -789
  312. package/assets/skills/security-testing/schemas/output.json +879 -879
  313. package/assets/skills/security-visual-testing/evals/security-visual-testing.yaml +163 -163
  314. package/assets/skills/security-visual-testing/schemas/output.json +486 -486
  315. package/assets/skills/sfdipot-product-factors/SKILL.md +239 -239
  316. package/assets/skills/sherlock-review/schemas/output.json +297 -297
  317. package/assets/skills/shift-left-testing/evals/shift-left-testing.yaml +145 -145
  318. package/assets/skills/shift-left-testing/schemas/output.json +459 -459
  319. package/assets/skills/shift-right-testing/evals/shift-right-testing.yaml +147 -147
  320. package/assets/skills/shift-right-testing/schemas/output.json +418 -418
  321. package/assets/skills/tdd-london-chicago/schemas/output.json +444 -444
  322. package/assets/skills/technical-writing/schemas/output.json +268 -268
  323. package/assets/skills/test-automation-strategy/evals/test-automation-strategy.yaml +148 -148
  324. package/assets/skills/test-automation-strategy/schemas/output.json +444 -444
  325. package/assets/skills/test-data-management/evals/test-data-management.yaml +504 -504
  326. package/assets/skills/test-data-management/schemas/output.json +284 -284
  327. package/assets/skills/test-design-techniques/evals/test-design-techniques.yaml +142 -142
  328. package/assets/skills/test-design-techniques/schemas/output.json +295 -295
  329. package/assets/skills/test-environment-management/schemas/output.json +310 -310
  330. package/assets/skills/test-idea-rewriting/SKILL.md +229 -229
  331. package/assets/skills/test-reporting-analytics/evals/test-reporting-analytics.yaml +155 -155
  332. package/assets/skills/test-reporting-analytics/schemas/output.json +329 -329
  333. package/assets/skills/testability-scoring/evals/testability-scoring.yaml +814 -814
  334. package/assets/skills/testability-scoring/resources/templates/config.template.js +84 -84
  335. package/assets/skills/testability-scoring/schemas/output.json +606 -606
  336. package/assets/skills/testability-scoring/scripts/generate-html-report.js +1007 -1007
  337. package/assets/skills/verification-quality/evals/verification-quality.yaml +150 -150
  338. package/assets/skills/verification-quality/schemas/output.json +432 -432
  339. package/assets/skills/visual-testing-advanced/evals/visual-testing-advanced.yaml +154 -154
  340. package/assets/skills/visual-testing-advanced/schemas/output.json +294 -294
  341. package/assets/skills/wms-testing-patterns/evals/wms-testing-patterns.yaml +165 -165
  342. package/assets/skills/wms-testing-patterns/schemas/output.json +150 -150
  343. package/assets/skills/wms-testing-patterns/scripts/validate-config.json +51 -51
  344. package/assets/templates/validation-summary.json +56 -56
  345. package/dist/cli/bundle.js +54 -31
  346. package/dist/cli/commands/mcp.d.ts.map +1 -1
  347. package/dist/cli/commands/mcp.js +11 -9
  348. package/dist/cli/commands/mcp.js.map +1 -1
  349. package/dist/init/phases/10-workers.js +2 -2
  350. package/dist/init/phases/10-workers.js.map +1 -1
  351. package/dist/mcp/bundle.js +42 -19
  352. package/dist/shared/language-detector.js +1 -1
  353. package/dist/shared/language-detector.js.map +1 -1
  354. package/dist/shared/parsers/multi-language-parser.d.ts.map +1 -1
  355. package/dist/shared/parsers/multi-language-parser.js +55 -16
  356. package/dist/shared/parsers/multi-language-parser.js.map +1 -1
  357. package/package.json +1 -1
  358. package/scripts/prepare-assets.sh +8 -0
@@ -1,798 +1,798 @@
1
- ---
2
- name: middleware-testing-patterns
3
- description: "Enterprise middleware testing patterns for message routing, transformation, DLQ, protocol mediation, ESB error handling, and EIP patterns. Use when testing middleware layers, message brokers, ESBs, or integration buses."
4
- category: enterprise-integration
5
- priority: high
6
- tokenEstimate: 1800
7
- agents: [qe-middleware-validator, qe-message-broker-tester, qe-soap-tester]
8
- implementation_status: optimized
9
- optimization_version: 1.0
10
- last_optimized: 2026-02-04
11
- dependencies: [api-testing-patterns, contract-testing]
12
- quick_reference_card: true
13
- tags: [middleware, esb, soap, messaging, iib, mq, transformation, routing]
14
- trust_tier: 3
15
- validation:
16
- schema_path: schemas/output.json
17
- validator_path: scripts/validate-config.json
18
- eval_path: evals/middleware-testing-patterns.yaml
19
- ---
20
-
21
- # Middleware Testing Patterns
22
-
23
- <default_to_action>
24
- When testing enterprise middleware, ESBs, or message-driven systems:
25
- 1. VALIDATE message routing logic (content-based, header-based, recipient list)
26
- 2. TEST message transformations end-to-end (input format -> output format)
27
- 3. VERIFY dead letter queue handling (poison messages, retry exhaustion)
28
- 4. ASSERT message ordering and sequencing with correlation IDs
29
- 5. EXERCISE error handling and compensation patterns
30
- 6. TEST protocol mediation (SOAP-to-REST, sync-to-async)
31
- 7. VALIDATE EIP patterns (splitter, aggregator, content enricher, normalizer)
32
-
33
- **Quick Pattern Selection:**
34
- - Message routing issues -> Content-based router tests
35
- - Transformation failures -> Schema-in/schema-out validation
36
- - Lost messages -> DLQ and retry pattern tests
37
- - Protocol bridging -> Mediation round-trip tests
38
- - Complex flows -> Correlation ID tracing tests
39
-
40
- **Critical Success Factors:**
41
- - Middleware is invisible when it works; test the invisible
42
- - Always validate both the happy path AND the error channel (DLQ)
43
- - Correlation IDs are your lifeline for tracing multi-hop messages
44
- </default_to_action>
45
-
46
- ## Quick Reference Card
47
-
48
- ### When to Use
49
- - Testing ESB message flows (IBM IIB/ACE, MuleSoft, WSO2)
50
- - Validating message transformations (XSLT, JSON-to-XML, flat-file parsing)
51
- - Testing message broker routing (MQ, Kafka, RabbitMQ)
52
- - Verifying dead letter queue behavior
53
- - Testing protocol mediation (SOAP/REST bridging)
54
- - Validating Enterprise Integration Patterns (EIP)
55
-
56
- ### Testing Levels
57
- | Level | Purpose | Dependencies | Speed |
58
- |-------|---------|--------------|-------|
59
- | Unit Transform | Single mapping correctness | None | Fast |
60
- | Route Logic | Routing decision accuracy | Mocked endpoints | Fast |
61
- | Integration | End-to-end message flow | Broker + endpoints | Medium |
62
- | DLQ/Error | Error handling and recovery | Full middleware stack | Slower |
63
-
64
- ### Critical Test Scenarios
65
- | Scenario | Must Test | Example |
66
- |----------|----------|---------|
67
- | Routing | Correct destination selection | Order type A -> Queue A, type B -> Queue B |
68
- | Transformation | Schema compliance after mapping | XML -> JSON field mapping accuracy |
69
- | DLQ | Poison message handling | Malformed XML lands in DLQ, not lost |
70
- | Ordering | Sequence preservation | Messages 1-2-3 arrive in order |
71
- | Correlation | Multi-hop tracing | Request-reply matched by correlation ID |
72
- | Retry | Transient failure recovery | 3 retries with backoff, then DLQ |
73
- | Mediation | Protocol bridging fidelity | SOAP request produces correct REST call |
74
-
75
- ### Tools
76
- - **Message Brokers**: IBM MQ, RabbitMQ, Apache Kafka, ActiveMQ
77
- - **ESBs**: IBM IIB/ACE, MuleSoft, WSO2, Apache Camel
78
- - **Testing**: SoapUI, Postman, custom harnesses
79
- - **Virtualization**: Mountebank, WireMock, HoverFly
80
- - **Monitoring**: Splunk, ELK, Datadog
81
-
82
- ### Agent Coordination
83
- - `qe-middleware-validator`: Validate routing rules, transformation accuracy, EIP patterns
84
- - `qe-message-broker-tester`: Test broker connectivity, DLQ behavior, message ordering
85
- - `qe-soap-tester`: SOAP/WSDL validation, WS-Security, protocol mediation
86
-
87
- ---
88
-
89
- ## Message Routing Pattern Testing
90
-
91
- ### Content-Based Router
92
- ```javascript
93
- describe('Content-Based Router - Order Type', () => {
94
- it('routes standard orders to fulfillment queue', async () => {
95
- const message = {
96
- correlationId: uuid(),
97
- body: { orderType: 'STANDARD', orderId: 'ORD-001', items: [{ sku: 'A1', qty: 2 }] }
98
- };
99
-
100
- await broker.publish('orders.inbound', message);
101
-
102
- const routed = await broker.consume('orders.fulfillment', { timeout: 5000 });
103
- expect(routed.body.orderId).toBe('ORD-001');
104
- expect(routed.correlationId).toBe(message.correlationId);
105
-
106
- const dlq = await broker.tryConsume('orders.dlq', { timeout: 1000 });
107
- expect(dlq).toBeNull(); // Nothing in DLQ
108
- });
109
-
110
- it('routes express orders to priority queue', async () => {
111
- const message = {
112
- correlationId: uuid(),
113
- body: { orderType: 'EXPRESS', orderId: 'ORD-002', items: [{ sku: 'B1', qty: 1 }] }
114
- };
115
-
116
- await broker.publish('orders.inbound', message);
117
-
118
- const routed = await broker.consume('orders.priority', { timeout: 5000 });
119
- expect(routed.body.orderId).toBe('ORD-002');
120
- });
121
-
122
- it('sends unrecognized order types to DLQ', async () => {
123
- const message = {
124
- correlationId: uuid(),
125
- body: { orderType: 'UNKNOWN', orderId: 'ORD-003' }
126
- };
127
-
128
- await broker.publish('orders.inbound', message);
129
-
130
- const dlqMessage = await broker.consume('orders.dlq', { timeout: 5000 });
131
- expect(dlqMessage.body.orderId).toBe('ORD-003');
132
- expect(dlqMessage.headers['x-error-reason']).toContain('Unrecognized orderType');
133
- });
134
- });
135
- ```
136
-
137
- ### Header-Based Router
138
- ```javascript
139
- describe('Header-Based Router - Region', () => {
140
- it('routes by x-region header to regional queues', async () => {
141
- const regions = ['US', 'EU', 'APAC'];
142
-
143
- for (const region of regions) {
144
- const message = {
145
- headers: { 'x-region': region },
146
- body: { orderId: `ORD-${region}` }
147
- };
148
-
149
- await broker.publish('orders.global', message);
150
-
151
- const routed = await broker.consume(`orders.${region.toLowerCase()}`, { timeout: 5000 });
152
- expect(routed.body.orderId).toBe(`ORD-${region}`);
153
- }
154
- });
155
-
156
- it('routes messages without region header to default queue', async () => {
157
- await broker.publish('orders.global', { body: { orderId: 'ORD-NO-REGION' } });
158
-
159
- const routed = await broker.consume('orders.default', { timeout: 5000 });
160
- expect(routed.body.orderId).toBe('ORD-NO-REGION');
161
- });
162
- });
163
- ```
164
-
165
- ### Recipient List
166
- ```javascript
167
- describe('Recipient List - Order Notifications', () => {
168
- it('fans out order to all registered recipients', async () => {
169
- const message = {
170
- body: { orderId: 'ORD-100', total: 250.00 }
171
- };
172
-
173
- await broker.publish('orders.confirmed', message);
174
-
175
- // All three systems should receive the message
176
- const [warehouse, billing, crm] = await Promise.all([
177
- broker.consume('notify.warehouse', { timeout: 5000 }),
178
- broker.consume('notify.billing', { timeout: 5000 }),
179
- broker.consume('notify.crm', { timeout: 5000 })
180
- ]);
181
-
182
- expect(warehouse.body.orderId).toBe('ORD-100');
183
- expect(billing.body.orderId).toBe('ORD-100');
184
- expect(crm.body.orderId).toBe('ORD-100');
185
- });
186
- });
187
- ```
188
-
189
- ---
190
-
191
- ## Message Transformation Testing
192
-
193
- ### JSON-to-XML Transformation
194
- ```javascript
195
- describe('JSON to XML Transformation', () => {
196
- it('transforms order JSON to SAP XML format', async () => {
197
- const jsonInput = {
198
- orderId: 'ORD-500',
199
- customer: { id: 'CUST-01', name: 'Acme Corp' },
200
- items: [
201
- { sku: 'MAT-100', quantity: 10, unitPrice: 25.00 }
202
- ]
203
- };
204
-
205
- await broker.publish('transform.json-in', { body: jsonInput });
206
-
207
- const xmlOutput = await broker.consume('transform.xml-out', { timeout: 5000 });
208
- const parsed = parseXml(xmlOutput.body);
209
-
210
- expect(parsed.SalesOrder.OrderNumber).toBe('ORD-500');
211
- expect(parsed.SalesOrder.SoldToParty.CustomerID).toBe('CUST-01');
212
- expect(parsed.SalesOrder.Items.Item[0].MaterialNumber).toBe('MAT-100');
213
- expect(parsed.SalesOrder.Items.Item[0].Quantity).toBe('10');
214
- });
215
-
216
- it('handles missing optional fields gracefully', async () => {
217
- const jsonInput = {
218
- orderId: 'ORD-501',
219
- customer: { id: 'CUST-02' }, // name is missing
220
- items: [{ sku: 'MAT-200', quantity: 5 }] // unitPrice missing
221
- };
222
-
223
- await broker.publish('transform.json-in', { body: jsonInput });
224
-
225
- const xmlOutput = await broker.consume('transform.xml-out', { timeout: 5000 });
226
- const parsed = parseXml(xmlOutput.body);
227
-
228
- expect(parsed.SalesOrder.SoldToParty.Name).toBe(''); // Default empty
229
- expect(parsed.SalesOrder.Items.Item[0].UnitPrice).toBe('0.00');
230
- });
231
-
232
- it('rejects invalid input and sends to DLQ with error details', async () => {
233
- const invalidInput = { items: [] }; // Missing required orderId and customer
234
-
235
- await broker.publish('transform.json-in', { body: invalidInput });
236
-
237
- const dlq = await broker.consume('transform.dlq', { timeout: 5000 });
238
- expect(dlq.headers['x-error-reason']).toContain('orderId is required');
239
- });
240
- });
241
- ```
242
-
243
- ### Flat-File to XML Transformation
244
- ```javascript
245
- describe('Flat-File to XML Transformation', () => {
246
- it('parses fixed-width flat file into structured XML', async () => {
247
- // Fixed-width: positions 1-10 = orderId, 11-20 = sku, 21-25 = qty
248
- const flatFile = 'ORD-001 MAT-10000010\nORD-001 MAT-20000005\n';
249
-
250
- await broker.publish('transform.flatfile-in', { body: flatFile });
251
-
252
- const xmlOutput = await broker.consume('transform.flatfile-xml-out', { timeout: 5000 });
253
- const parsed = parseXml(xmlOutput.body);
254
-
255
- expect(parsed.Orders.Order).toHaveLength(1);
256
- expect(parsed.Orders.Order[0].Items.Item).toHaveLength(2);
257
- expect(parsed.Orders.Order[0].Items.Item[0].Quantity).toBe('10');
258
- });
259
-
260
- it('handles lines with trailing whitespace correctly', async () => {
261
- const flatFile = 'ORD-002 MAT-30000001 \n';
262
-
263
- await broker.publish('transform.flatfile-in', { body: flatFile });
264
-
265
- const xmlOutput = await broker.consume('transform.flatfile-xml-out', { timeout: 5000 });
266
- const parsed = parseXml(xmlOutput.body);
267
-
268
- expect(parsed.Orders.Order[0].OrderId).toBe('ORD-002');
269
- expect(parsed.Orders.Order[0].Items.Item[0].Quantity).toBe('1');
270
- });
271
- });
272
- ```
273
-
274
- ---
275
-
276
- ## Dead Letter Queue (DLQ) Testing
277
-
278
- ```javascript
279
- describe('Dead Letter Queue Strategy', () => {
280
- it('moves message to DLQ after max retries', async () => {
281
- // Configure endpoint to always fail
282
- mockEndpoint.respondWith(500, 'Service Unavailable');
283
-
284
- await broker.publish('orders.process', {
285
- body: { orderId: 'ORD-FAIL' },
286
- headers: { 'x-correlation-id': 'corr-123' }
287
- });
288
-
289
- // Wait for retries to exhaust (3 retries with backoff)
290
- const dlqMessage = await broker.consume('orders.dlq', { timeout: 30000 });
291
-
292
- expect(dlqMessage.body.orderId).toBe('ORD-FAIL');
293
- expect(dlqMessage.headers['x-retry-count']).toBe('3');
294
- expect(dlqMessage.headers['x-original-queue']).toBe('orders.process');
295
- expect(dlqMessage.headers['x-correlation-id']).toBe('corr-123');
296
- expect(dlqMessage.headers['x-error-reason']).toContain('Service Unavailable');
297
- expect(dlqMessage.headers['x-first-failure-timestamp']).toBeDefined();
298
- });
299
-
300
- it('preserves original message body in DLQ', async () => {
301
- const originalBody = {
302
- orderId: 'ORD-PRESERVE',
303
- items: [{ sku: 'A', qty: 1 }, { sku: 'B', qty: 2 }]
304
- };
305
-
306
- mockEndpoint.respondWith(500, 'Timeout');
307
- await broker.publish('orders.process', { body: originalBody });
308
-
309
- const dlqMessage = await broker.consume('orders.dlq', { timeout: 30000 });
310
- expect(dlqMessage.body).toEqual(originalBody); // Body unchanged
311
- });
312
-
313
- it('DLQ messages can be replayed after fix', async () => {
314
- // Step 1: Message fails, lands in DLQ
315
- mockEndpoint.respondWith(500, 'Down');
316
- await broker.publish('orders.process', { body: { orderId: 'ORD-REPLAY' } });
317
- const dlqMessage = await broker.consume('orders.dlq', { timeout: 30000 });
318
-
319
- // Step 2: Fix the endpoint
320
- mockEndpoint.respondWith(200, 'OK');
321
-
322
- // Step 3: Replay from DLQ
323
- await broker.publish('orders.process', dlqMessage);
324
- const success = await broker.consume('orders.completed', { timeout: 5000 });
325
- expect(success.body.orderId).toBe('ORD-REPLAY');
326
- });
327
- });
328
- ```
329
-
330
- ---
331
-
332
- ## Message Ordering and Sequencing
333
-
334
- ```javascript
335
- describe('Message Ordering Validation', () => {
336
- it('preserves FIFO order within same partition key', async () => {
337
- const messages = Array.from({ length: 10 }, (_, i) => ({
338
- headers: { 'x-partition-key': 'ORDER-GROUP-1', 'x-sequence': String(i + 1) },
339
- body: { orderId: `ORD-${i + 1}`, sequence: i + 1 }
340
- }));
341
-
342
- for (const msg of messages) {
343
- await broker.publish('orders.sequenced', msg);
344
- }
345
-
346
- const received = [];
347
- for (let i = 0; i < 10; i++) {
348
- const msg = await broker.consume('orders.sequenced.out', { timeout: 5000 });
349
- received.push(msg.body.sequence);
350
- }
351
-
352
- expect(received).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
353
- });
354
-
355
- it('detects out-of-order messages via sequence gap', async () => {
356
- // Send messages 1, 2, 4 (skip 3)
357
- for (const seq of [1, 2, 4]) {
358
- await broker.publish('orders.sequenced', {
359
- headers: { 'x-partition-key': 'GROUP-2', 'x-sequence': String(seq) },
360
- body: { sequence: seq }
361
- });
362
- }
363
-
364
- // The middleware should detect the gap and raise an alert
365
- const alert = await broker.consume('orders.sequence-gap', { timeout: 10000 });
366
- expect(alert.body.missingSequence).toBe(3);
367
- expect(alert.body.partitionKey).toBe('GROUP-2');
368
- });
369
- });
370
- ```
371
-
372
- ---
373
-
374
- ## ESB Error Handling and Compensation
375
-
376
- ```javascript
377
- describe('Compensation Pattern - Saga', () => {
378
- it('compensates completed steps when a later step fails', async () => {
379
- // Saga: Reserve Inventory -> Charge Payment -> Ship
380
- // If Ship fails, Payment and Inventory must be compensated
381
-
382
- mockServices.inventory.respondWith(200); // Step 1 succeeds
383
- mockServices.payment.respondWith(200); // Step 2 succeeds
384
- mockServices.shipping.respondWith(500); // Step 3 fails
385
-
386
- await broker.publish('saga.order', {
387
- body: { orderId: 'ORD-SAGA', amount: 100.00 }
388
- });
389
-
390
- // Verify compensation messages were sent
391
- const paymentRefund = await broker.consume('saga.compensate.payment', { timeout: 10000 });
392
- expect(paymentRefund.body.action).toBe('REFUND');
393
- expect(paymentRefund.body.orderId).toBe('ORD-SAGA');
394
-
395
- const inventoryRelease = await broker.consume('saga.compensate.inventory', { timeout: 10000 });
396
- expect(inventoryRelease.body.action).toBe('RELEASE');
397
- expect(inventoryRelease.body.orderId).toBe('ORD-SAGA');
398
- });
399
- });
400
- ```
401
-
402
- ---
403
-
404
- ## Protocol Mediation Testing
405
-
406
- ### SOAP-to-REST Mediation
407
- ```javascript
408
- describe('SOAP to REST Protocol Mediation', () => {
409
- it('converts SOAP request to REST call and back', async () => {
410
- const soapRequest = `
411
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
412
- xmlns:ord="http://example.com/orders">
413
- <soapenv:Body>
414
- <ord:GetOrder>
415
- <ord:OrderId>ORD-700</ord:OrderId>
416
- </ord:GetOrder>
417
- </soapenv:Body>
418
- </soapenv:Envelope>
419
- `;
420
-
421
- // ESB should convert SOAP -> REST GET /orders/ORD-700
422
- mockRestBackend.onGet('/orders/ORD-700').reply(200, {
423
- orderId: 'ORD-700',
424
- status: 'SHIPPED',
425
- total: 150.00
426
- });
427
-
428
- const response = await soapClient.send(soapRequest, { endpoint: esbSoapEndpoint });
429
-
430
- // Verify SOAP response wraps REST data correctly
431
- const parsed = parseSoapResponse(response);
432
- expect(parsed.OrderId).toBe('ORD-700');
433
- expect(parsed.Status).toBe('SHIPPED');
434
- expect(parsed.Total).toBe('150.00');
435
- });
436
-
437
- it('maps REST error to SOAP fault', async () => {
438
- const soapRequest = buildSoapGetOrder('ORD-NOTFOUND');
439
-
440
- mockRestBackend.onGet('/orders/ORD-NOTFOUND').reply(404, {
441
- error: 'Order not found'
442
- });
443
-
444
- const response = await soapClient.send(soapRequest, { endpoint: esbSoapEndpoint });
445
- const fault = parseSoapFault(response);
446
-
447
- expect(fault.faultCode).toBe('Client');
448
- expect(fault.faultString).toContain('Order not found');
449
- });
450
- });
451
- ```
452
-
453
- ### Sync-to-Async Mediation
454
- ```javascript
455
- describe('Sync to Async Mediation', () => {
456
- it('accepts sync request, returns correlation ID, delivers result async', async () => {
457
- // Client sends synchronous HTTP POST
458
- const response = await httpClient.post(`${esbEndpoint}/async-orders`, {
459
- orderId: 'ORD-ASYNC',
460
- items: [{ sku: 'X1', qty: 5 }]
461
- });
462
-
463
- // ESB returns 202 Accepted with correlation ID
464
- expect(response.status).toBe(202);
465
- expect(response.body.correlationId).toBeDefined();
466
- const correlationId = response.body.correlationId;
467
-
468
- // Result arrives asynchronously on callback queue
469
- const result = await broker.consume('orders.async.results', {
470
- timeout: 15000,
471
- filter: (msg) => msg.headers['x-correlation-id'] === correlationId
472
- });
473
-
474
- expect(result.body.orderId).toBe('ORD-ASYNC');
475
- expect(result.body.status).toBe('ACCEPTED');
476
- });
477
- });
478
- ```
479
-
480
- ---
481
-
482
- ## Enterprise Integration Patterns (EIP)
483
-
484
- ### Splitter Pattern
485
- ```javascript
486
- describe('Splitter - Batch Order to Individual Items', () => {
487
- it('splits batch order into individual item messages', async () => {
488
- const batchOrder = {
489
- orderId: 'BATCH-001',
490
- items: [
491
- { sku: 'A1', qty: 10 },
492
- { sku: 'B2', qty: 5 },
493
- { sku: 'C3', qty: 20 }
494
- ]
495
- };
496
-
497
- await broker.publish('orders.batch', { body: batchOrder });
498
-
499
- const splitMessages = [];
500
- for (let i = 0; i < 3; i++) {
501
- splitMessages.push(await broker.consume('orders.items', { timeout: 5000 }));
502
- }
503
-
504
- expect(splitMessages).toHaveLength(3);
505
- expect(splitMessages.map(m => m.body.sku).sort()).toEqual(['A1', 'B2', 'C3']);
506
-
507
- // Each split message retains parent correlation
508
- for (const msg of splitMessages) {
509
- expect(msg.headers['x-batch-id']).toBe('BATCH-001');
510
- expect(msg.headers['x-split-total']).toBe('3');
511
- }
512
- });
513
- });
514
- ```
515
-
516
- ### Aggregator Pattern
517
- ```javascript
518
- describe('Aggregator - Collect Item Results', () => {
519
- it('aggregates individual item results into batch response', async () => {
520
- const batchId = 'BATCH-002';
521
- const itemResults = [
522
- { sku: 'A1', status: 'PICKED', batchId },
523
- { sku: 'B2', status: 'PICKED', batchId },
524
- { sku: 'C3', status: 'PICKED', batchId }
525
- ];
526
-
527
- for (const result of itemResults) {
528
- await broker.publish('items.completed', {
529
- headers: { 'x-batch-id': batchId, 'x-split-total': '3' },
530
- body: result
531
- });
532
- }
533
-
534
- const aggregated = await broker.consume('orders.batch.completed', { timeout: 10000 });
535
-
536
- expect(aggregated.body.batchId).toBe('BATCH-002');
537
- expect(aggregated.body.items).toHaveLength(3);
538
- expect(aggregated.body.items.every(i => i.status === 'PICKED')).toBe(true);
539
- });
540
-
541
- it('handles aggregation timeout for incomplete batches', async () => {
542
- const batchId = 'BATCH-TIMEOUT';
543
-
544
- // Only send 2 of 3 expected items
545
- for (let i = 0; i < 2; i++) {
546
- await broker.publish('items.completed', {
547
- headers: { 'x-batch-id': batchId, 'x-split-total': '3' },
548
- body: { sku: `ITEM-${i}`, status: 'PICKED', batchId }
549
- });
550
- }
551
-
552
- // After timeout, aggregator should emit partial result with error
553
- const partial = await broker.consume('orders.batch.incomplete', { timeout: 60000 });
554
- expect(partial.body.batchId).toBe('BATCH-TIMEOUT');
555
- expect(partial.body.receivedCount).toBe(2);
556
- expect(partial.body.expectedCount).toBe(3);
557
- });
558
- });
559
- ```
560
-
561
- ### Content Enricher Pattern
562
- ```javascript
563
- describe('Content Enricher - Customer Data Lookup', () => {
564
- it('enriches order with customer details from CRM', async () => {
565
- mockCrm.onGet('/customers/CUST-50').reply(200, {
566
- name: 'Acme Corp',
567
- tier: 'GOLD',
568
- creditLimit: 50000
569
- });
570
-
571
- await broker.publish('orders.enrich', {
572
- body: { orderId: 'ORD-ENRICH', customerId: 'CUST-50', total: 1200 }
573
- });
574
-
575
- const enriched = await broker.consume('orders.enriched', { timeout: 5000 });
576
-
577
- expect(enriched.body.orderId).toBe('ORD-ENRICH');
578
- expect(enriched.body.customer.name).toBe('Acme Corp');
579
- expect(enriched.body.customer.tier).toBe('GOLD');
580
- expect(enriched.body.creditCheckPassed).toBe(true); // 1200 < 50000
581
- });
582
- });
583
- ```
584
-
585
- ---
586
-
587
- ## Retry and Circuit Breaker Patterns
588
-
589
- ```javascript
590
- describe('Retry with Exponential Backoff', () => {
591
- it('retries 3 times with increasing delays before DLQ', async () => {
592
- const timestamps = [];
593
- mockEndpoint.onPost('/process').reply(() => {
594
- timestamps.push(Date.now());
595
- return [500, 'Temporary failure'];
596
- });
597
-
598
- await broker.publish('orders.process', { body: { orderId: 'ORD-RETRY' } });
599
-
600
- await broker.consume('orders.dlq', { timeout: 60000 });
601
-
602
- // Verify exponential backoff timing (1s, 2s, 4s approximately)
603
- expect(timestamps).toHaveLength(4); // 1 initial + 3 retries
604
- const delay1 = timestamps[1] - timestamps[0];
605
- const delay2 = timestamps[2] - timestamps[1];
606
- expect(delay1).toBeGreaterThan(800); // ~1s
607
- expect(delay2).toBeGreaterThan(1800); // ~2s
608
- });
609
- });
610
-
611
- describe('Circuit Breaker', () => {
612
- it('opens circuit after threshold failures', async () => {
613
- // Fail 5 messages to trip circuit breaker (threshold = 5)
614
- mockEndpoint.onPost('/process').reply(500, 'Down');
615
-
616
- for (let i = 0; i < 5; i++) {
617
- await broker.publish('orders.circuit', { body: { orderId: `ORD-CB-${i}` } });
618
- }
619
-
620
- // Wait for circuit to open
621
- await sleep(5000);
622
-
623
- // Next message should be immediately rejected (circuit open)
624
- const startTime = Date.now();
625
- await broker.publish('orders.circuit', { body: { orderId: 'ORD-CB-FAST-FAIL' } });
626
- const dlq = await broker.consume('orders.circuit.dlq', { timeout: 3000 });
627
- const elapsed = Date.now() - startTime;
628
-
629
- expect(dlq.headers['x-circuit-state']).toBe('OPEN');
630
- expect(elapsed).toBeLessThan(2000); // Fast fail, no retry
631
- });
632
- });
633
- ```
634
-
635
- ---
636
-
637
- ## Service Virtualization for Isolated Testing
638
-
639
- ```javascript
640
- describe('Service Virtualization - Middleware Isolation', () => {
641
- let virtualService;
642
-
643
- beforeAll(async () => {
644
- virtualService = await mountebank.createImposter({
645
- port: 4545,
646
- protocol: 'http',
647
- stubs: [
648
- {
649
- predicates: [{ equals: { method: 'POST', path: '/sap/orders' } }],
650
- responses: [{
651
- is: {
652
- statusCode: 200,
653
- headers: { 'Content-Type': 'application/xml' },
654
- body: '<OrderResponse><Status>CREATED</Status><SapOrderId>SAP-001</SapOrderId></OrderResponse>'
655
- }
656
- }]
657
- },
658
- {
659
- predicates: [{ equals: { method: 'POST', path: '/sap/orders' },
660
- contains: { body: '<InvalidField>' } }],
661
- responses: [{
662
- is: { statusCode: 400, body: '<Error>Invalid request</Error>' }
663
- }]
664
- }
665
- ]
666
- });
667
- });
668
-
669
- afterAll(async () => {
670
- await mountebank.deleteImposter(4545);
671
- });
672
-
673
- it('middleware correctly handles SAP success response', async () => {
674
- await broker.publish('orders.to-sap', {
675
- body: { orderId: 'ORD-VIRT', customer: 'CUST-01' }
676
- });
677
-
678
- const result = await broker.consume('orders.sap-confirmed', { timeout: 5000 });
679
- expect(result.body.sapOrderId).toBe('SAP-001');
680
- });
681
- });
682
- ```
683
-
684
- ---
685
-
686
- ## Best Practices
687
-
688
- ### Do This
689
- - Test both the happy path AND the error channel (DLQ) for every flow
690
- - Use correlation IDs to trace messages across multi-hop middleware
691
- - Validate schema compliance at every transformation boundary
692
- - Test message ordering with partitioned/sequenced queues
693
- - Use service virtualization to isolate middleware from backend systems
694
- - Test retry exhaustion to confirm DLQ behavior
695
- - Validate compensation patterns (saga rollback) for multi-step flows
696
-
697
- ### Avoid This
698
- - Testing only the happy path and ignoring DLQ/error queues
699
- - Hardcoding queue names; use configuration-driven tests
700
- - Ignoring message ordering requirements
701
- - Skipping transformation edge cases (empty fields, special characters, encoding)
702
- - Testing middleware without correlation ID validation
703
- - Assuming retries work correctly without verifying backoff timing
704
- - Deploying without testing the circuit breaker threshold
705
-
706
- ---
707
-
708
- ## Agent-Assisted Middleware Testing
709
-
710
- ```typescript
711
- // Validate middleware routing rules
712
- await Task("Middleware Routing Validation", {
713
- routingConfig: 'esb/routing-rules.xml',
714
- messageTypes: ['STANDARD_ORDER', 'EXPRESS_ORDER', 'RETURN'],
715
- validateDLQ: true,
716
- checkCorrelationIds: true
717
- }, "qe-middleware-validator");
718
-
719
- // Test message broker behavior
720
- await Task("Message Broker DLQ Test", {
721
- broker: 'rabbitmq',
722
- queues: ['orders.inbound', 'orders.process', 'orders.dlq'],
723
- retryPolicy: { maxRetries: 3, backoff: 'exponential' },
724
- poisonMessages: ['malformed-xml', 'missing-required-fields', 'oversized-payload']
725
- }, "qe-message-broker-tester");
726
-
727
- // SOAP/WSDL contract validation
728
- await Task("SOAP Service Contract Validation", {
729
- wsdl: 'services/OrderService.wsdl',
730
- endpoints: ['CreateOrder', 'GetOrderStatus', 'CancelOrder'],
731
- validateWsSecurity: true,
732
- testFaultHandling: true
733
- }, "qe-soap-tester");
734
-
735
- // Transformation accuracy testing
736
- await Task("Transformation Accuracy Suite", {
737
- transformations: [
738
- { name: 'JSON-to-SAP-XML', input: 'testdata/order.json', expected: 'testdata/order-sap.xml' },
739
- { name: 'Flat-to-XML', input: 'testdata/inventory.dat', expected: 'testdata/inventory.xml' }
740
- ],
741
- validateSchemas: true,
742
- edgeCases: ['empty-fields', 'special-chars', 'max-length']
743
- }, "qe-middleware-validator");
744
- ```
745
-
746
- ---
747
-
748
- ## Agent Coordination Hints
749
-
750
- ### Memory Namespace
751
- ```
752
- aqe/middleware-testing/
753
- routing/ - Routing rule configurations and test results
754
- transformations/ - Mapping definitions and validation results
755
- dlq/ - DLQ test results and replay outcomes
756
- eip-patterns/ - EIP pattern test coverage
757
- circuit-breakers/ - Circuit breaker state and threshold configs
758
- correlation/ - Correlation ID tracing results
759
- ```
760
-
761
- ### Fleet Coordination
762
- ```typescript
763
- const middlewareFleet = await FleetManager.coordinate({
764
- strategy: 'middleware-testing',
765
- agents: [
766
- 'qe-middleware-validator', // Routing, transformation, EIP patterns
767
- 'qe-message-broker-tester', // DLQ, ordering, retry, circuit breaker
768
- 'qe-soap-tester' // SOAP contracts, WS-Security, mediation
769
- ],
770
- topology: 'mesh'
771
- });
772
-
773
- await middlewareFleet.execute({
774
- flows: [
775
- { name: 'order-inbound', stages: ['route', 'transform', 'enrich', 'deliver'] },
776
- { name: 'payment-processing', stages: ['validate', 'authorize', 'settle'] }
777
- ],
778
- testDLQ: true,
779
- testCompensation: true
780
- });
781
- ```
782
-
783
- ---
784
-
785
- ## Related Skills
786
- - [api-testing-patterns](../api-testing-patterns/) - REST/GraphQL API testing fundamentals
787
- - [contract-testing](../contract-testing/) - Consumer-driven contract testing with Pact
788
- - [enterprise-integration-testing](../enterprise-integration-testing/) - Orchestrating all enterprise agents
789
- - [chaos-engineering-resilience](../chaos-engineering-resilience/) - Fault injection and resilience testing
790
- - [wms-testing-patterns](../wms-testing-patterns/) - Warehouse system integration testing
791
-
792
- ---
793
-
794
- ## Remember
795
-
796
- Middleware is the nervous system of enterprise architecture. When it works, nobody notices. When it fails, everything breaks. Test the routing decisions, the transformations, the error channels, and the compensation patterns. Always validate with correlation IDs across multi-hop flows, and always confirm that poison messages end up in the DLQ with enough metadata to diagnose and replay.
797
-
798
- **With Agents:** Agents validate routing rules against message types, test transformation accuracy with schema compliance, and exercise DLQ/retry/circuit-breaker behavior systematically. Use agents to cover the combinatorial explosion of routing paths and transformation edge cases that manual testing cannot reach.
1
+ ---
2
+ name: middleware-testing-patterns
3
+ description: "Enterprise middleware testing patterns for message routing, transformation, DLQ, protocol mediation, ESB error handling, and EIP patterns. Use when testing middleware layers, message brokers, ESBs, or integration buses."
4
+ category: enterprise-integration
5
+ priority: high
6
+ tokenEstimate: 1800
7
+ agents: [qe-middleware-validator, qe-message-broker-tester, qe-soap-tester]
8
+ implementation_status: optimized
9
+ optimization_version: 1.0
10
+ last_optimized: 2026-02-04
11
+ dependencies: [api-testing-patterns, contract-testing]
12
+ quick_reference_card: true
13
+ tags: [middleware, esb, soap, messaging, iib, mq, transformation, routing]
14
+ trust_tier: 3
15
+ validation:
16
+ schema_path: schemas/output.json
17
+ validator_path: scripts/validate-config.json
18
+ eval_path: evals/middleware-testing-patterns.yaml
19
+ ---
20
+
21
+ # Middleware Testing Patterns
22
+
23
+ <default_to_action>
24
+ When testing enterprise middleware, ESBs, or message-driven systems:
25
+ 1. VALIDATE message routing logic (content-based, header-based, recipient list)
26
+ 2. TEST message transformations end-to-end (input format -> output format)
27
+ 3. VERIFY dead letter queue handling (poison messages, retry exhaustion)
28
+ 4. ASSERT message ordering and sequencing with correlation IDs
29
+ 5. EXERCISE error handling and compensation patterns
30
+ 6. TEST protocol mediation (SOAP-to-REST, sync-to-async)
31
+ 7. VALIDATE EIP patterns (splitter, aggregator, content enricher, normalizer)
32
+
33
+ **Quick Pattern Selection:**
34
+ - Message routing issues -> Content-based router tests
35
+ - Transformation failures -> Schema-in/schema-out validation
36
+ - Lost messages -> DLQ and retry pattern tests
37
+ - Protocol bridging -> Mediation round-trip tests
38
+ - Complex flows -> Correlation ID tracing tests
39
+
40
+ **Critical Success Factors:**
41
+ - Middleware is invisible when it works; test the invisible
42
+ - Always validate both the happy path AND the error channel (DLQ)
43
+ - Correlation IDs are your lifeline for tracing multi-hop messages
44
+ </default_to_action>
45
+
46
+ ## Quick Reference Card
47
+
48
+ ### When to Use
49
+ - Testing ESB message flows (IBM IIB/ACE, MuleSoft, WSO2)
50
+ - Validating message transformations (XSLT, JSON-to-XML, flat-file parsing)
51
+ - Testing message broker routing (MQ, Kafka, RabbitMQ)
52
+ - Verifying dead letter queue behavior
53
+ - Testing protocol mediation (SOAP/REST bridging)
54
+ - Validating Enterprise Integration Patterns (EIP)
55
+
56
+ ### Testing Levels
57
+ | Level | Purpose | Dependencies | Speed |
58
+ |-------|---------|--------------|-------|
59
+ | Unit Transform | Single mapping correctness | None | Fast |
60
+ | Route Logic | Routing decision accuracy | Mocked endpoints | Fast |
61
+ | Integration | End-to-end message flow | Broker + endpoints | Medium |
62
+ | DLQ/Error | Error handling and recovery | Full middleware stack | Slower |
63
+
64
+ ### Critical Test Scenarios
65
+ | Scenario | Must Test | Example |
66
+ |----------|----------|---------|
67
+ | Routing | Correct destination selection | Order type A -> Queue A, type B -> Queue B |
68
+ | Transformation | Schema compliance after mapping | XML -> JSON field mapping accuracy |
69
+ | DLQ | Poison message handling | Malformed XML lands in DLQ, not lost |
70
+ | Ordering | Sequence preservation | Messages 1-2-3 arrive in order |
71
+ | Correlation | Multi-hop tracing | Request-reply matched by correlation ID |
72
+ | Retry | Transient failure recovery | 3 retries with backoff, then DLQ |
73
+ | Mediation | Protocol bridging fidelity | SOAP request produces correct REST call |
74
+
75
+ ### Tools
76
+ - **Message Brokers**: IBM MQ, RabbitMQ, Apache Kafka, ActiveMQ
77
+ - **ESBs**: IBM IIB/ACE, MuleSoft, WSO2, Apache Camel
78
+ - **Testing**: SoapUI, Postman, custom harnesses
79
+ - **Virtualization**: Mountebank, WireMock, HoverFly
80
+ - **Monitoring**: Splunk, ELK, Datadog
81
+
82
+ ### Agent Coordination
83
+ - `qe-middleware-validator`: Validate routing rules, transformation accuracy, EIP patterns
84
+ - `qe-message-broker-tester`: Test broker connectivity, DLQ behavior, message ordering
85
+ - `qe-soap-tester`: SOAP/WSDL validation, WS-Security, protocol mediation
86
+
87
+ ---
88
+
89
+ ## Message Routing Pattern Testing
90
+
91
+ ### Content-Based Router
92
+ ```javascript
93
+ describe('Content-Based Router - Order Type', () => {
94
+ it('routes standard orders to fulfillment queue', async () => {
95
+ const message = {
96
+ correlationId: uuid(),
97
+ body: { orderType: 'STANDARD', orderId: 'ORD-001', items: [{ sku: 'A1', qty: 2 }] }
98
+ };
99
+
100
+ await broker.publish('orders.inbound', message);
101
+
102
+ const routed = await broker.consume('orders.fulfillment', { timeout: 5000 });
103
+ expect(routed.body.orderId).toBe('ORD-001');
104
+ expect(routed.correlationId).toBe(message.correlationId);
105
+
106
+ const dlq = await broker.tryConsume('orders.dlq', { timeout: 1000 });
107
+ expect(dlq).toBeNull(); // Nothing in DLQ
108
+ });
109
+
110
+ it('routes express orders to priority queue', async () => {
111
+ const message = {
112
+ correlationId: uuid(),
113
+ body: { orderType: 'EXPRESS', orderId: 'ORD-002', items: [{ sku: 'B1', qty: 1 }] }
114
+ };
115
+
116
+ await broker.publish('orders.inbound', message);
117
+
118
+ const routed = await broker.consume('orders.priority', { timeout: 5000 });
119
+ expect(routed.body.orderId).toBe('ORD-002');
120
+ });
121
+
122
+ it('sends unrecognized order types to DLQ', async () => {
123
+ const message = {
124
+ correlationId: uuid(),
125
+ body: { orderType: 'UNKNOWN', orderId: 'ORD-003' }
126
+ };
127
+
128
+ await broker.publish('orders.inbound', message);
129
+
130
+ const dlqMessage = await broker.consume('orders.dlq', { timeout: 5000 });
131
+ expect(dlqMessage.body.orderId).toBe('ORD-003');
132
+ expect(dlqMessage.headers['x-error-reason']).toContain('Unrecognized orderType');
133
+ });
134
+ });
135
+ ```
136
+
137
+ ### Header-Based Router
138
+ ```javascript
139
+ describe('Header-Based Router - Region', () => {
140
+ it('routes by x-region header to regional queues', async () => {
141
+ const regions = ['US', 'EU', 'APAC'];
142
+
143
+ for (const region of regions) {
144
+ const message = {
145
+ headers: { 'x-region': region },
146
+ body: { orderId: `ORD-${region}` }
147
+ };
148
+
149
+ await broker.publish('orders.global', message);
150
+
151
+ const routed = await broker.consume(`orders.${region.toLowerCase()}`, { timeout: 5000 });
152
+ expect(routed.body.orderId).toBe(`ORD-${region}`);
153
+ }
154
+ });
155
+
156
+ it('routes messages without region header to default queue', async () => {
157
+ await broker.publish('orders.global', { body: { orderId: 'ORD-NO-REGION' } });
158
+
159
+ const routed = await broker.consume('orders.default', { timeout: 5000 });
160
+ expect(routed.body.orderId).toBe('ORD-NO-REGION');
161
+ });
162
+ });
163
+ ```
164
+
165
+ ### Recipient List
166
+ ```javascript
167
+ describe('Recipient List - Order Notifications', () => {
168
+ it('fans out order to all registered recipients', async () => {
169
+ const message = {
170
+ body: { orderId: 'ORD-100', total: 250.00 }
171
+ };
172
+
173
+ await broker.publish('orders.confirmed', message);
174
+
175
+ // All three systems should receive the message
176
+ const [warehouse, billing, crm] = await Promise.all([
177
+ broker.consume('notify.warehouse', { timeout: 5000 }),
178
+ broker.consume('notify.billing', { timeout: 5000 }),
179
+ broker.consume('notify.crm', { timeout: 5000 })
180
+ ]);
181
+
182
+ expect(warehouse.body.orderId).toBe('ORD-100');
183
+ expect(billing.body.orderId).toBe('ORD-100');
184
+ expect(crm.body.orderId).toBe('ORD-100');
185
+ });
186
+ });
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Message Transformation Testing
192
+
193
+ ### JSON-to-XML Transformation
194
+ ```javascript
195
+ describe('JSON to XML Transformation', () => {
196
+ it('transforms order JSON to SAP XML format', async () => {
197
+ const jsonInput = {
198
+ orderId: 'ORD-500',
199
+ customer: { id: 'CUST-01', name: 'Acme Corp' },
200
+ items: [
201
+ { sku: 'MAT-100', quantity: 10, unitPrice: 25.00 }
202
+ ]
203
+ };
204
+
205
+ await broker.publish('transform.json-in', { body: jsonInput });
206
+
207
+ const xmlOutput = await broker.consume('transform.xml-out', { timeout: 5000 });
208
+ const parsed = parseXml(xmlOutput.body);
209
+
210
+ expect(parsed.SalesOrder.OrderNumber).toBe('ORD-500');
211
+ expect(parsed.SalesOrder.SoldToParty.CustomerID).toBe('CUST-01');
212
+ expect(parsed.SalesOrder.Items.Item[0].MaterialNumber).toBe('MAT-100');
213
+ expect(parsed.SalesOrder.Items.Item[0].Quantity).toBe('10');
214
+ });
215
+
216
+ it('handles missing optional fields gracefully', async () => {
217
+ const jsonInput = {
218
+ orderId: 'ORD-501',
219
+ customer: { id: 'CUST-02' }, // name is missing
220
+ items: [{ sku: 'MAT-200', quantity: 5 }] // unitPrice missing
221
+ };
222
+
223
+ await broker.publish('transform.json-in', { body: jsonInput });
224
+
225
+ const xmlOutput = await broker.consume('transform.xml-out', { timeout: 5000 });
226
+ const parsed = parseXml(xmlOutput.body);
227
+
228
+ expect(parsed.SalesOrder.SoldToParty.Name).toBe(''); // Default empty
229
+ expect(parsed.SalesOrder.Items.Item[0].UnitPrice).toBe('0.00');
230
+ });
231
+
232
+ it('rejects invalid input and sends to DLQ with error details', async () => {
233
+ const invalidInput = { items: [] }; // Missing required orderId and customer
234
+
235
+ await broker.publish('transform.json-in', { body: invalidInput });
236
+
237
+ const dlq = await broker.consume('transform.dlq', { timeout: 5000 });
238
+ expect(dlq.headers['x-error-reason']).toContain('orderId is required');
239
+ });
240
+ });
241
+ ```
242
+
243
+ ### Flat-File to XML Transformation
244
+ ```javascript
245
+ describe('Flat-File to XML Transformation', () => {
246
+ it('parses fixed-width flat file into structured XML', async () => {
247
+ // Fixed-width: positions 1-10 = orderId, 11-20 = sku, 21-25 = qty
248
+ const flatFile = 'ORD-001 MAT-10000010\nORD-001 MAT-20000005\n';
249
+
250
+ await broker.publish('transform.flatfile-in', { body: flatFile });
251
+
252
+ const xmlOutput = await broker.consume('transform.flatfile-xml-out', { timeout: 5000 });
253
+ const parsed = parseXml(xmlOutput.body);
254
+
255
+ expect(parsed.Orders.Order).toHaveLength(1);
256
+ expect(parsed.Orders.Order[0].Items.Item).toHaveLength(2);
257
+ expect(parsed.Orders.Order[0].Items.Item[0].Quantity).toBe('10');
258
+ });
259
+
260
+ it('handles lines with trailing whitespace correctly', async () => {
261
+ const flatFile = 'ORD-002 MAT-30000001 \n';
262
+
263
+ await broker.publish('transform.flatfile-in', { body: flatFile });
264
+
265
+ const xmlOutput = await broker.consume('transform.flatfile-xml-out', { timeout: 5000 });
266
+ const parsed = parseXml(xmlOutput.body);
267
+
268
+ expect(parsed.Orders.Order[0].OrderId).toBe('ORD-002');
269
+ expect(parsed.Orders.Order[0].Items.Item[0].Quantity).toBe('1');
270
+ });
271
+ });
272
+ ```
273
+
274
+ ---
275
+
276
+ ## Dead Letter Queue (DLQ) Testing
277
+
278
+ ```javascript
279
+ describe('Dead Letter Queue Strategy', () => {
280
+ it('moves message to DLQ after max retries', async () => {
281
+ // Configure endpoint to always fail
282
+ mockEndpoint.respondWith(500, 'Service Unavailable');
283
+
284
+ await broker.publish('orders.process', {
285
+ body: { orderId: 'ORD-FAIL' },
286
+ headers: { 'x-correlation-id': 'corr-123' }
287
+ });
288
+
289
+ // Wait for retries to exhaust (3 retries with backoff)
290
+ const dlqMessage = await broker.consume('orders.dlq', { timeout: 30000 });
291
+
292
+ expect(dlqMessage.body.orderId).toBe('ORD-FAIL');
293
+ expect(dlqMessage.headers['x-retry-count']).toBe('3');
294
+ expect(dlqMessage.headers['x-original-queue']).toBe('orders.process');
295
+ expect(dlqMessage.headers['x-correlation-id']).toBe('corr-123');
296
+ expect(dlqMessage.headers['x-error-reason']).toContain('Service Unavailable');
297
+ expect(dlqMessage.headers['x-first-failure-timestamp']).toBeDefined();
298
+ });
299
+
300
+ it('preserves original message body in DLQ', async () => {
301
+ const originalBody = {
302
+ orderId: 'ORD-PRESERVE',
303
+ items: [{ sku: 'A', qty: 1 }, { sku: 'B', qty: 2 }]
304
+ };
305
+
306
+ mockEndpoint.respondWith(500, 'Timeout');
307
+ await broker.publish('orders.process', { body: originalBody });
308
+
309
+ const dlqMessage = await broker.consume('orders.dlq', { timeout: 30000 });
310
+ expect(dlqMessage.body).toEqual(originalBody); // Body unchanged
311
+ });
312
+
313
+ it('DLQ messages can be replayed after fix', async () => {
314
+ // Step 1: Message fails, lands in DLQ
315
+ mockEndpoint.respondWith(500, 'Down');
316
+ await broker.publish('orders.process', { body: { orderId: 'ORD-REPLAY' } });
317
+ const dlqMessage = await broker.consume('orders.dlq', { timeout: 30000 });
318
+
319
+ // Step 2: Fix the endpoint
320
+ mockEndpoint.respondWith(200, 'OK');
321
+
322
+ // Step 3: Replay from DLQ
323
+ await broker.publish('orders.process', dlqMessage);
324
+ const success = await broker.consume('orders.completed', { timeout: 5000 });
325
+ expect(success.body.orderId).toBe('ORD-REPLAY');
326
+ });
327
+ });
328
+ ```
329
+
330
+ ---
331
+
332
+ ## Message Ordering and Sequencing
333
+
334
+ ```javascript
335
+ describe('Message Ordering Validation', () => {
336
+ it('preserves FIFO order within same partition key', async () => {
337
+ const messages = Array.from({ length: 10 }, (_, i) => ({
338
+ headers: { 'x-partition-key': 'ORDER-GROUP-1', 'x-sequence': String(i + 1) },
339
+ body: { orderId: `ORD-${i + 1}`, sequence: i + 1 }
340
+ }));
341
+
342
+ for (const msg of messages) {
343
+ await broker.publish('orders.sequenced', msg);
344
+ }
345
+
346
+ const received = [];
347
+ for (let i = 0; i < 10; i++) {
348
+ const msg = await broker.consume('orders.sequenced.out', { timeout: 5000 });
349
+ received.push(msg.body.sequence);
350
+ }
351
+
352
+ expect(received).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
353
+ });
354
+
355
+ it('detects out-of-order messages via sequence gap', async () => {
356
+ // Send messages 1, 2, 4 (skip 3)
357
+ for (const seq of [1, 2, 4]) {
358
+ await broker.publish('orders.sequenced', {
359
+ headers: { 'x-partition-key': 'GROUP-2', 'x-sequence': String(seq) },
360
+ body: { sequence: seq }
361
+ });
362
+ }
363
+
364
+ // The middleware should detect the gap and raise an alert
365
+ const alert = await broker.consume('orders.sequence-gap', { timeout: 10000 });
366
+ expect(alert.body.missingSequence).toBe(3);
367
+ expect(alert.body.partitionKey).toBe('GROUP-2');
368
+ });
369
+ });
370
+ ```
371
+
372
+ ---
373
+
374
+ ## ESB Error Handling and Compensation
375
+
376
+ ```javascript
377
+ describe('Compensation Pattern - Saga', () => {
378
+ it('compensates completed steps when a later step fails', async () => {
379
+ // Saga: Reserve Inventory -> Charge Payment -> Ship
380
+ // If Ship fails, Payment and Inventory must be compensated
381
+
382
+ mockServices.inventory.respondWith(200); // Step 1 succeeds
383
+ mockServices.payment.respondWith(200); // Step 2 succeeds
384
+ mockServices.shipping.respondWith(500); // Step 3 fails
385
+
386
+ await broker.publish('saga.order', {
387
+ body: { orderId: 'ORD-SAGA', amount: 100.00 }
388
+ });
389
+
390
+ // Verify compensation messages were sent
391
+ const paymentRefund = await broker.consume('saga.compensate.payment', { timeout: 10000 });
392
+ expect(paymentRefund.body.action).toBe('REFUND');
393
+ expect(paymentRefund.body.orderId).toBe('ORD-SAGA');
394
+
395
+ const inventoryRelease = await broker.consume('saga.compensate.inventory', { timeout: 10000 });
396
+ expect(inventoryRelease.body.action).toBe('RELEASE');
397
+ expect(inventoryRelease.body.orderId).toBe('ORD-SAGA');
398
+ });
399
+ });
400
+ ```
401
+
402
+ ---
403
+
404
+ ## Protocol Mediation Testing
405
+
406
+ ### SOAP-to-REST Mediation
407
+ ```javascript
408
+ describe('SOAP to REST Protocol Mediation', () => {
409
+ it('converts SOAP request to REST call and back', async () => {
410
+ const soapRequest = `
411
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
412
+ xmlns:ord="http://example.com/orders">
413
+ <soapenv:Body>
414
+ <ord:GetOrder>
415
+ <ord:OrderId>ORD-700</ord:OrderId>
416
+ </ord:GetOrder>
417
+ </soapenv:Body>
418
+ </soapenv:Envelope>
419
+ `;
420
+
421
+ // ESB should convert SOAP -> REST GET /orders/ORD-700
422
+ mockRestBackend.onGet('/orders/ORD-700').reply(200, {
423
+ orderId: 'ORD-700',
424
+ status: 'SHIPPED',
425
+ total: 150.00
426
+ });
427
+
428
+ const response = await soapClient.send(soapRequest, { endpoint: esbSoapEndpoint });
429
+
430
+ // Verify SOAP response wraps REST data correctly
431
+ const parsed = parseSoapResponse(response);
432
+ expect(parsed.OrderId).toBe('ORD-700');
433
+ expect(parsed.Status).toBe('SHIPPED');
434
+ expect(parsed.Total).toBe('150.00');
435
+ });
436
+
437
+ it('maps REST error to SOAP fault', async () => {
438
+ const soapRequest = buildSoapGetOrder('ORD-NOTFOUND');
439
+
440
+ mockRestBackend.onGet('/orders/ORD-NOTFOUND').reply(404, {
441
+ error: 'Order not found'
442
+ });
443
+
444
+ const response = await soapClient.send(soapRequest, { endpoint: esbSoapEndpoint });
445
+ const fault = parseSoapFault(response);
446
+
447
+ expect(fault.faultCode).toBe('Client');
448
+ expect(fault.faultString).toContain('Order not found');
449
+ });
450
+ });
451
+ ```
452
+
453
+ ### Sync-to-Async Mediation
454
+ ```javascript
455
+ describe('Sync to Async Mediation', () => {
456
+ it('accepts sync request, returns correlation ID, delivers result async', async () => {
457
+ // Client sends synchronous HTTP POST
458
+ const response = await httpClient.post(`${esbEndpoint}/async-orders`, {
459
+ orderId: 'ORD-ASYNC',
460
+ items: [{ sku: 'X1', qty: 5 }]
461
+ });
462
+
463
+ // ESB returns 202 Accepted with correlation ID
464
+ expect(response.status).toBe(202);
465
+ expect(response.body.correlationId).toBeDefined();
466
+ const correlationId = response.body.correlationId;
467
+
468
+ // Result arrives asynchronously on callback queue
469
+ const result = await broker.consume('orders.async.results', {
470
+ timeout: 15000,
471
+ filter: (msg) => msg.headers['x-correlation-id'] === correlationId
472
+ });
473
+
474
+ expect(result.body.orderId).toBe('ORD-ASYNC');
475
+ expect(result.body.status).toBe('ACCEPTED');
476
+ });
477
+ });
478
+ ```
479
+
480
+ ---
481
+
482
+ ## Enterprise Integration Patterns (EIP)
483
+
484
+ ### Splitter Pattern
485
+ ```javascript
486
+ describe('Splitter - Batch Order to Individual Items', () => {
487
+ it('splits batch order into individual item messages', async () => {
488
+ const batchOrder = {
489
+ orderId: 'BATCH-001',
490
+ items: [
491
+ { sku: 'A1', qty: 10 },
492
+ { sku: 'B2', qty: 5 },
493
+ { sku: 'C3', qty: 20 }
494
+ ]
495
+ };
496
+
497
+ await broker.publish('orders.batch', { body: batchOrder });
498
+
499
+ const splitMessages = [];
500
+ for (let i = 0; i < 3; i++) {
501
+ splitMessages.push(await broker.consume('orders.items', { timeout: 5000 }));
502
+ }
503
+
504
+ expect(splitMessages).toHaveLength(3);
505
+ expect(splitMessages.map(m => m.body.sku).sort()).toEqual(['A1', 'B2', 'C3']);
506
+
507
+ // Each split message retains parent correlation
508
+ for (const msg of splitMessages) {
509
+ expect(msg.headers['x-batch-id']).toBe('BATCH-001');
510
+ expect(msg.headers['x-split-total']).toBe('3');
511
+ }
512
+ });
513
+ });
514
+ ```
515
+
516
+ ### Aggregator Pattern
517
+ ```javascript
518
+ describe('Aggregator - Collect Item Results', () => {
519
+ it('aggregates individual item results into batch response', async () => {
520
+ const batchId = 'BATCH-002';
521
+ const itemResults = [
522
+ { sku: 'A1', status: 'PICKED', batchId },
523
+ { sku: 'B2', status: 'PICKED', batchId },
524
+ { sku: 'C3', status: 'PICKED', batchId }
525
+ ];
526
+
527
+ for (const result of itemResults) {
528
+ await broker.publish('items.completed', {
529
+ headers: { 'x-batch-id': batchId, 'x-split-total': '3' },
530
+ body: result
531
+ });
532
+ }
533
+
534
+ const aggregated = await broker.consume('orders.batch.completed', { timeout: 10000 });
535
+
536
+ expect(aggregated.body.batchId).toBe('BATCH-002');
537
+ expect(aggregated.body.items).toHaveLength(3);
538
+ expect(aggregated.body.items.every(i => i.status === 'PICKED')).toBe(true);
539
+ });
540
+
541
+ it('handles aggregation timeout for incomplete batches', async () => {
542
+ const batchId = 'BATCH-TIMEOUT';
543
+
544
+ // Only send 2 of 3 expected items
545
+ for (let i = 0; i < 2; i++) {
546
+ await broker.publish('items.completed', {
547
+ headers: { 'x-batch-id': batchId, 'x-split-total': '3' },
548
+ body: { sku: `ITEM-${i}`, status: 'PICKED', batchId }
549
+ });
550
+ }
551
+
552
+ // After timeout, aggregator should emit partial result with error
553
+ const partial = await broker.consume('orders.batch.incomplete', { timeout: 60000 });
554
+ expect(partial.body.batchId).toBe('BATCH-TIMEOUT');
555
+ expect(partial.body.receivedCount).toBe(2);
556
+ expect(partial.body.expectedCount).toBe(3);
557
+ });
558
+ });
559
+ ```
560
+
561
+ ### Content Enricher Pattern
562
+ ```javascript
563
+ describe('Content Enricher - Customer Data Lookup', () => {
564
+ it('enriches order with customer details from CRM', async () => {
565
+ mockCrm.onGet('/customers/CUST-50').reply(200, {
566
+ name: 'Acme Corp',
567
+ tier: 'GOLD',
568
+ creditLimit: 50000
569
+ });
570
+
571
+ await broker.publish('orders.enrich', {
572
+ body: { orderId: 'ORD-ENRICH', customerId: 'CUST-50', total: 1200 }
573
+ });
574
+
575
+ const enriched = await broker.consume('orders.enriched', { timeout: 5000 });
576
+
577
+ expect(enriched.body.orderId).toBe('ORD-ENRICH');
578
+ expect(enriched.body.customer.name).toBe('Acme Corp');
579
+ expect(enriched.body.customer.tier).toBe('GOLD');
580
+ expect(enriched.body.creditCheckPassed).toBe(true); // 1200 < 50000
581
+ });
582
+ });
583
+ ```
584
+
585
+ ---
586
+
587
+ ## Retry and Circuit Breaker Patterns
588
+
589
+ ```javascript
590
+ describe('Retry with Exponential Backoff', () => {
591
+ it('retries 3 times with increasing delays before DLQ', async () => {
592
+ const timestamps = [];
593
+ mockEndpoint.onPost('/process').reply(() => {
594
+ timestamps.push(Date.now());
595
+ return [500, 'Temporary failure'];
596
+ });
597
+
598
+ await broker.publish('orders.process', { body: { orderId: 'ORD-RETRY' } });
599
+
600
+ await broker.consume('orders.dlq', { timeout: 60000 });
601
+
602
+ // Verify exponential backoff timing (1s, 2s, 4s approximately)
603
+ expect(timestamps).toHaveLength(4); // 1 initial + 3 retries
604
+ const delay1 = timestamps[1] - timestamps[0];
605
+ const delay2 = timestamps[2] - timestamps[1];
606
+ expect(delay1).toBeGreaterThan(800); // ~1s
607
+ expect(delay2).toBeGreaterThan(1800); // ~2s
608
+ });
609
+ });
610
+
611
+ describe('Circuit Breaker', () => {
612
+ it('opens circuit after threshold failures', async () => {
613
+ // Fail 5 messages to trip circuit breaker (threshold = 5)
614
+ mockEndpoint.onPost('/process').reply(500, 'Down');
615
+
616
+ for (let i = 0; i < 5; i++) {
617
+ await broker.publish('orders.circuit', { body: { orderId: `ORD-CB-${i}` } });
618
+ }
619
+
620
+ // Wait for circuit to open
621
+ await sleep(5000);
622
+
623
+ // Next message should be immediately rejected (circuit open)
624
+ const startTime = Date.now();
625
+ await broker.publish('orders.circuit', { body: { orderId: 'ORD-CB-FAST-FAIL' } });
626
+ const dlq = await broker.consume('orders.circuit.dlq', { timeout: 3000 });
627
+ const elapsed = Date.now() - startTime;
628
+
629
+ expect(dlq.headers['x-circuit-state']).toBe('OPEN');
630
+ expect(elapsed).toBeLessThan(2000); // Fast fail, no retry
631
+ });
632
+ });
633
+ ```
634
+
635
+ ---
636
+
637
+ ## Service Virtualization for Isolated Testing
638
+
639
+ ```javascript
640
+ describe('Service Virtualization - Middleware Isolation', () => {
641
+ let virtualService;
642
+
643
+ beforeAll(async () => {
644
+ virtualService = await mountebank.createImposter({
645
+ port: 4545,
646
+ protocol: 'http',
647
+ stubs: [
648
+ {
649
+ predicates: [{ equals: { method: 'POST', path: '/sap/orders' } }],
650
+ responses: [{
651
+ is: {
652
+ statusCode: 200,
653
+ headers: { 'Content-Type': 'application/xml' },
654
+ body: '<OrderResponse><Status>CREATED</Status><SapOrderId>SAP-001</SapOrderId></OrderResponse>'
655
+ }
656
+ }]
657
+ },
658
+ {
659
+ predicates: [{ equals: { method: 'POST', path: '/sap/orders' },
660
+ contains: { body: '<InvalidField>' } }],
661
+ responses: [{
662
+ is: { statusCode: 400, body: '<Error>Invalid request</Error>' }
663
+ }]
664
+ }
665
+ ]
666
+ });
667
+ });
668
+
669
+ afterAll(async () => {
670
+ await mountebank.deleteImposter(4545);
671
+ });
672
+
673
+ it('middleware correctly handles SAP success response', async () => {
674
+ await broker.publish('orders.to-sap', {
675
+ body: { orderId: 'ORD-VIRT', customer: 'CUST-01' }
676
+ });
677
+
678
+ const result = await broker.consume('orders.sap-confirmed', { timeout: 5000 });
679
+ expect(result.body.sapOrderId).toBe('SAP-001');
680
+ });
681
+ });
682
+ ```
683
+
684
+ ---
685
+
686
+ ## Best Practices
687
+
688
+ ### Do This
689
+ - Test both the happy path AND the error channel (DLQ) for every flow
690
+ - Use correlation IDs to trace messages across multi-hop middleware
691
+ - Validate schema compliance at every transformation boundary
692
+ - Test message ordering with partitioned/sequenced queues
693
+ - Use service virtualization to isolate middleware from backend systems
694
+ - Test retry exhaustion to confirm DLQ behavior
695
+ - Validate compensation patterns (saga rollback) for multi-step flows
696
+
697
+ ### Avoid This
698
+ - Testing only the happy path and ignoring DLQ/error queues
699
+ - Hardcoding queue names; use configuration-driven tests
700
+ - Ignoring message ordering requirements
701
+ - Skipping transformation edge cases (empty fields, special characters, encoding)
702
+ - Testing middleware without correlation ID validation
703
+ - Assuming retries work correctly without verifying backoff timing
704
+ - Deploying without testing the circuit breaker threshold
705
+
706
+ ---
707
+
708
+ ## Agent-Assisted Middleware Testing
709
+
710
+ ```typescript
711
+ // Validate middleware routing rules
712
+ await Task("Middleware Routing Validation", {
713
+ routingConfig: 'esb/routing-rules.xml',
714
+ messageTypes: ['STANDARD_ORDER', 'EXPRESS_ORDER', 'RETURN'],
715
+ validateDLQ: true,
716
+ checkCorrelationIds: true
717
+ }, "qe-middleware-validator");
718
+
719
+ // Test message broker behavior
720
+ await Task("Message Broker DLQ Test", {
721
+ broker: 'rabbitmq',
722
+ queues: ['orders.inbound', 'orders.process', 'orders.dlq'],
723
+ retryPolicy: { maxRetries: 3, backoff: 'exponential' },
724
+ poisonMessages: ['malformed-xml', 'missing-required-fields', 'oversized-payload']
725
+ }, "qe-message-broker-tester");
726
+
727
+ // SOAP/WSDL contract validation
728
+ await Task("SOAP Service Contract Validation", {
729
+ wsdl: 'services/OrderService.wsdl',
730
+ endpoints: ['CreateOrder', 'GetOrderStatus', 'CancelOrder'],
731
+ validateWsSecurity: true,
732
+ testFaultHandling: true
733
+ }, "qe-soap-tester");
734
+
735
+ // Transformation accuracy testing
736
+ await Task("Transformation Accuracy Suite", {
737
+ transformations: [
738
+ { name: 'JSON-to-SAP-XML', input: 'testdata/order.json', expected: 'testdata/order-sap.xml' },
739
+ { name: 'Flat-to-XML', input: 'testdata/inventory.dat', expected: 'testdata/inventory.xml' }
740
+ ],
741
+ validateSchemas: true,
742
+ edgeCases: ['empty-fields', 'special-chars', 'max-length']
743
+ }, "qe-middleware-validator");
744
+ ```
745
+
746
+ ---
747
+
748
+ ## Agent Coordination Hints
749
+
750
+ ### Memory Namespace
751
+ ```
752
+ aqe/middleware-testing/
753
+ routing/ - Routing rule configurations and test results
754
+ transformations/ - Mapping definitions and validation results
755
+ dlq/ - DLQ test results and replay outcomes
756
+ eip-patterns/ - EIP pattern test coverage
757
+ circuit-breakers/ - Circuit breaker state and threshold configs
758
+ correlation/ - Correlation ID tracing results
759
+ ```
760
+
761
+ ### Fleet Coordination
762
+ ```typescript
763
+ const middlewareFleet = await FleetManager.coordinate({
764
+ strategy: 'middleware-testing',
765
+ agents: [
766
+ 'qe-middleware-validator', // Routing, transformation, EIP patterns
767
+ 'qe-message-broker-tester', // DLQ, ordering, retry, circuit breaker
768
+ 'qe-soap-tester' // SOAP contracts, WS-Security, mediation
769
+ ],
770
+ topology: 'mesh'
771
+ });
772
+
773
+ await middlewareFleet.execute({
774
+ flows: [
775
+ { name: 'order-inbound', stages: ['route', 'transform', 'enrich', 'deliver'] },
776
+ { name: 'payment-processing', stages: ['validate', 'authorize', 'settle'] }
777
+ ],
778
+ testDLQ: true,
779
+ testCompensation: true
780
+ });
781
+ ```
782
+
783
+ ---
784
+
785
+ ## Related Skills
786
+ - [api-testing-patterns](../api-testing-patterns/) - REST/GraphQL API testing fundamentals
787
+ - [contract-testing](../contract-testing/) - Consumer-driven contract testing with Pact
788
+ - [enterprise-integration-testing](../enterprise-integration-testing/) - Orchestrating all enterprise agents
789
+ - [chaos-engineering-resilience](../chaos-engineering-resilience/) - Fault injection and resilience testing
790
+ - [wms-testing-patterns](../wms-testing-patterns/) - Warehouse system integration testing
791
+
792
+ ---
793
+
794
+ ## Remember
795
+
796
+ Middleware is the nervous system of enterprise architecture. When it works, nobody notices. When it fails, everything breaks. Test the routing decisions, the transformations, the error channels, and the compensation patterns. Always validate with correlation IDs across multi-hop flows, and always confirm that poison messages end up in the DLQ with enough metadata to diagnose and replay.
797
+
798
+ **With Agents:** Agents validate routing rules against message types, test transformation accuracy with schema compliance, and exercise DLQ/retry/circuit-breaker behavior systematically. Use agents to cover the combinatorial explosion of routing paths and transformation edge cases that manual testing cannot reach.