agentic-qe 3.5.4 → 3.6.0

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 (247) hide show
  1. package/.claude/agents/v3/README.md +1 -1
  2. package/.claude/agents/v3/qe-message-broker-tester.md +380 -0
  3. package/.claude/agents/v3/qe-middleware-validator.md +423 -0
  4. package/.claude/agents/v3/qe-odata-contract-tester.md +484 -0
  5. package/.claude/agents/v3/qe-pentest-validator.md +359 -0
  6. package/.claude/agents/v3/qe-qx-partner.md +85 -3
  7. package/.claude/agents/v3/qe-sap-idoc-tester.md +407 -0
  8. package/.claude/agents/v3/qe-sap-rfc-tester.md +357 -0
  9. package/.claude/agents/v3/qe-soap-tester.md +340 -0
  10. package/.claude/agents/v3/qe-sod-analyzer.md +528 -0
  11. package/.claude/agents/v3/templates/qx-report-template.html +437 -0
  12. package/.claude/skills/debug-loop/SKILL.md +61 -0
  13. package/.claude/skills/enterprise-integration-testing/SKILL.md +735 -0
  14. package/.claude/skills/middleware-testing-patterns/SKILL.md +798 -0
  15. package/.claude/skills/observability-testing-patterns/SKILL.md +930 -0
  16. package/.claude/skills/pentest-validation/SKILL.md +268 -0
  17. package/.claude/skills/pentest-validation/evals/pentest-validation.yaml +708 -0
  18. package/.claude/skills/pentest-validation/schemas/output.json +281 -0
  19. package/.claude/skills/pentest-validation/scripts/validate.sh +402 -0
  20. package/.claude/skills/pr-review/SKILL.md +61 -0
  21. package/.claude/skills/qcsd-cicd-swarm/SKILL.md +315 -13
  22. package/.claude/skills/qcsd-development-swarm/SKILL.md +331 -16
  23. package/.claude/skills/qcsd-ideation-swarm/SKILL.md +258 -9
  24. package/.claude/skills/qcsd-refinement-swarm/SKILL.md +344 -22
  25. package/.claude/skills/release/SKILL.md +333 -0
  26. package/.claude/skills/skills-manifest.json +5 -4
  27. package/.claude/skills/wms-testing-patterns/SKILL.md +949 -0
  28. package/README.md +30 -21
  29. package/package.json +2 -2
  30. package/v3/CHANGELOG.md +57 -0
  31. package/v3/README.md +23 -20
  32. package/v3/assets/agents/v3/qe-message-broker-tester.md +380 -0
  33. package/v3/assets/agents/v3/qe-middleware-validator.md +423 -0
  34. package/v3/assets/agents/v3/qe-odata-contract-tester.md +484 -0
  35. package/v3/assets/agents/v3/qe-pentest-validator.md +359 -0
  36. package/v3/assets/agents/v3/qe-qx-partner.md +90 -12
  37. package/v3/assets/agents/v3/qe-sap-idoc-tester.md +407 -0
  38. package/v3/assets/agents/v3/qe-sap-rfc-tester.md +357 -0
  39. package/v3/assets/agents/v3/qe-soap-tester.md +340 -0
  40. package/v3/assets/agents/v3/qe-sod-analyzer.md +528 -0
  41. package/v3/assets/agents/v3/templates/qx-report-template.html +437 -0
  42. package/v3/assets/skills/debug-loop/SKILL.md +61 -0
  43. package/v3/assets/skills/enterprise-integration-testing/SKILL.md +735 -0
  44. package/v3/assets/skills/middleware-testing-patterns/SKILL.md +798 -0
  45. package/v3/assets/skills/observability-testing-patterns/SKILL.md +930 -0
  46. package/v3/assets/skills/pentest-validation/SKILL.md +268 -0
  47. package/v3/assets/skills/pentest-validation/evals/pentest-validation.yaml +708 -0
  48. package/v3/assets/skills/pentest-validation/schemas/output.json +281 -0
  49. package/v3/assets/skills/pentest-validation/scripts/validate.sh +402 -0
  50. package/v3/assets/skills/pr-review/SKILL.md +61 -0
  51. package/v3/assets/skills/qcsd-cicd-swarm/SKILL.md +2206 -0
  52. package/v3/assets/skills/qcsd-development-swarm/SKILL.md +2154 -0
  53. package/v3/assets/skills/qcsd-ideation-swarm/SKILL.md +2008 -1753
  54. package/v3/assets/skills/qcsd-refinement-swarm/SKILL.md +2398 -0
  55. package/v3/assets/skills/security-visual-testing/SKILL.md +223 -0
  56. package/v3/assets/skills/security-visual-testing/evals/security-visual-testing.yaml +163 -0
  57. package/v3/assets/skills/security-visual-testing/schemas/output.json +486 -0
  58. package/v3/assets/skills/security-visual-testing/scripts/validate.sh +748 -0
  59. package/v3/assets/skills/sfdipot-product-factors/SKILL.md +239 -0
  60. package/v3/assets/skills/test-idea-rewriting/SKILL.md +229 -0
  61. package/v3/assets/skills/wms-testing-patterns/SKILL.md +949 -0
  62. package/v3/dist/cli/bundle.js +10816 -4625
  63. package/v3/dist/cli/commands/coverage.d.ts.map +1 -1
  64. package/v3/dist/cli/commands/coverage.js +29 -0
  65. package/v3/dist/cli/commands/coverage.js.map +1 -1
  66. package/v3/dist/cli/commands/learning.d.ts.map +1 -1
  67. package/v3/dist/cli/commands/learning.js +9 -0
  68. package/v3/dist/cli/commands/learning.js.map +1 -1
  69. package/v3/dist/cli/commands/token-usage.d.ts.map +1 -1
  70. package/v3/dist/cli/commands/token-usage.js +6 -2
  71. package/v3/dist/cli/commands/token-usage.js.map +1 -1
  72. package/v3/dist/coordination/protocols/learning-consolidation.d.ts.map +1 -1
  73. package/v3/dist/coordination/protocols/learning-consolidation.js +1 -0
  74. package/v3/dist/coordination/protocols/learning-consolidation.js.map +1 -1
  75. package/v3/dist/domains/coverage-analysis/coordinator.d.ts +8 -0
  76. package/v3/dist/domains/coverage-analysis/coordinator.d.ts.map +1 -1
  77. package/v3/dist/domains/coverage-analysis/coordinator.js +67 -0
  78. package/v3/dist/domains/coverage-analysis/coordinator.js.map +1 -1
  79. package/v3/dist/domains/coverage-analysis/interfaces.d.ts +33 -0
  80. package/v3/dist/domains/coverage-analysis/interfaces.d.ts.map +1 -1
  81. package/v3/dist/domains/coverage-analysis/plugin.d.ts.map +1 -1
  82. package/v3/dist/domains/coverage-analysis/plugin.js +17 -0
  83. package/v3/dist/domains/coverage-analysis/plugin.js.map +1 -1
  84. package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.d.ts +125 -0
  85. package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.d.ts.map +1 -0
  86. package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.js +317 -0
  87. package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.js.map +1 -0
  88. package/v3/dist/domains/coverage-analysis/services/index.d.ts +1 -0
  89. package/v3/dist/domains/coverage-analysis/services/index.d.ts.map +1 -1
  90. package/v3/dist/domains/coverage-analysis/services/index.js +4 -0
  91. package/v3/dist/domains/coverage-analysis/services/index.js.map +1 -1
  92. package/v3/dist/domains/enterprise-integration/coordinator.d.ts +91 -0
  93. package/v3/dist/domains/enterprise-integration/coordinator.d.ts.map +1 -0
  94. package/v3/dist/domains/enterprise-integration/coordinator.js +672 -0
  95. package/v3/dist/domains/enterprise-integration/coordinator.js.map +1 -0
  96. package/v3/dist/domains/enterprise-integration/index.d.ts +14 -0
  97. package/v3/dist/domains/enterprise-integration/index.d.ts.map +1 -0
  98. package/v3/dist/domains/enterprise-integration/index.js +18 -0
  99. package/v3/dist/domains/enterprise-integration/index.js.map +1 -0
  100. package/v3/dist/domains/enterprise-integration/interfaces.d.ts +376 -0
  101. package/v3/dist/domains/enterprise-integration/interfaces.d.ts.map +1 -0
  102. package/v3/dist/domains/enterprise-integration/interfaces.js +11 -0
  103. package/v3/dist/domains/enterprise-integration/interfaces.js.map +1 -0
  104. package/v3/dist/domains/enterprise-integration/plugin.d.ts +88 -0
  105. package/v3/dist/domains/enterprise-integration/plugin.d.ts.map +1 -0
  106. package/v3/dist/domains/enterprise-integration/plugin.js +515 -0
  107. package/v3/dist/domains/enterprise-integration/plugin.js.map +1 -0
  108. package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.d.ts +67 -0
  109. package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.d.ts.map +1 -0
  110. package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.js +670 -0
  111. package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.js.map +1 -0
  112. package/v3/dist/domains/enterprise-integration/services/index.d.ts +13 -0
  113. package/v3/dist/domains/enterprise-integration/services/index.d.ts.map +1 -0
  114. package/v3/dist/domains/enterprise-integration/services/index.js +13 -0
  115. package/v3/dist/domains/enterprise-integration/services/index.js.map +1 -0
  116. package/v3/dist/domains/enterprise-integration/services/message-broker-service.d.ts +88 -0
  117. package/v3/dist/domains/enterprise-integration/services/message-broker-service.d.ts.map +1 -0
  118. package/v3/dist/domains/enterprise-integration/services/message-broker-service.js +560 -0
  119. package/v3/dist/domains/enterprise-integration/services/message-broker-service.js.map +1 -0
  120. package/v3/dist/domains/enterprise-integration/services/odata-service.d.ts +75 -0
  121. package/v3/dist/domains/enterprise-integration/services/odata-service.d.ts.map +1 -0
  122. package/v3/dist/domains/enterprise-integration/services/odata-service.js +618 -0
  123. package/v3/dist/domains/enterprise-integration/services/odata-service.js.map +1 -0
  124. package/v3/dist/domains/enterprise-integration/services/sap-integration-service.d.ts +73 -0
  125. package/v3/dist/domains/enterprise-integration/services/sap-integration-service.d.ts.map +1 -0
  126. package/v3/dist/domains/enterprise-integration/services/sap-integration-service.js +513 -0
  127. package/v3/dist/domains/enterprise-integration/services/sap-integration-service.js.map +1 -0
  128. package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.d.ts +84 -0
  129. package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.d.ts.map +1 -0
  130. package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.js +639 -0
  131. package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.js.map +1 -0
  132. package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.d.ts +90 -0
  133. package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.d.ts.map +1 -0
  134. package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.js +389 -0
  135. package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.js.map +1 -0
  136. package/v3/dist/domains/index.d.ts +1 -0
  137. package/v3/dist/domains/index.d.ts.map +1 -1
  138. package/v3/dist/domains/index.js +1 -0
  139. package/v3/dist/domains/index.js.map +1 -1
  140. package/v3/dist/domains/learning-optimization/coordinator.d.ts.map +1 -1
  141. package/v3/dist/domains/learning-optimization/coordinator.js +1 -0
  142. package/v3/dist/domains/learning-optimization/coordinator.js.map +1 -1
  143. package/v3/dist/domains/learning-optimization/services/learning-coordinator.d.ts.map +1 -1
  144. package/v3/dist/domains/learning-optimization/services/learning-coordinator.js +1 -0
  145. package/v3/dist/domains/learning-optimization/services/learning-coordinator.js.map +1 -1
  146. package/v3/dist/domains/learning-optimization/services/transfer-specialist.d.ts.map +1 -1
  147. package/v3/dist/domains/learning-optimization/services/transfer-specialist.js +1 -0
  148. package/v3/dist/domains/learning-optimization/services/transfer-specialist.js.map +1 -1
  149. package/v3/dist/domains/test-execution/coordinator.d.ts.map +1 -1
  150. package/v3/dist/domains/test-execution/coordinator.js +34 -0
  151. package/v3/dist/domains/test-execution/coordinator.js.map +1 -1
  152. package/v3/dist/domains/test-generation/services/test-data-generator.d.ts +7 -1
  153. package/v3/dist/domains/test-generation/services/test-data-generator.d.ts.map +1 -1
  154. package/v3/dist/domains/test-generation/services/test-data-generator.js +116 -98
  155. package/v3/dist/domains/test-generation/services/test-data-generator.js.map +1 -1
  156. package/v3/dist/init/agents-installer.d.ts +4 -0
  157. package/v3/dist/init/agents-installer.d.ts.map +1 -1
  158. package/v3/dist/init/agents-installer.js +32 -3
  159. package/v3/dist/init/agents-installer.js.map +1 -1
  160. package/v3/dist/init/skills-installer.d.ts.map +1 -1
  161. package/v3/dist/init/skills-installer.js +4 -1
  162. package/v3/dist/init/skills-installer.js.map +1 -1
  163. package/v3/dist/init/types.d.ts.map +1 -1
  164. package/v3/dist/init/types.js +1 -0
  165. package/v3/dist/init/types.js.map +1 -1
  166. package/v3/dist/integrations/agentic-flow/model-router/budget-enforcer.d.ts +16 -0
  167. package/v3/dist/integrations/agentic-flow/model-router/budget-enforcer.d.ts.map +1 -1
  168. package/v3/dist/integrations/agentic-flow/model-router/budget-enforcer.js +41 -0
  169. package/v3/dist/integrations/agentic-flow/model-router/budget-enforcer.js.map +1 -1
  170. package/v3/dist/integrations/ruvector/provider.d.ts.map +1 -1
  171. package/v3/dist/integrations/ruvector/provider.js +1 -0
  172. package/v3/dist/integrations/ruvector/provider.js.map +1 -1
  173. package/v3/dist/kernel/anti-drift-middleware.d.ts +160 -0
  174. package/v3/dist/kernel/anti-drift-middleware.d.ts.map +1 -0
  175. package/v3/dist/kernel/anti-drift-middleware.js +376 -0
  176. package/v3/dist/kernel/anti-drift-middleware.js.map +1 -0
  177. package/v3/dist/kernel/event-bus.d.ts +29 -1
  178. package/v3/dist/kernel/event-bus.d.ts.map +1 -1
  179. package/v3/dist/kernel/event-bus.js +69 -6
  180. package/v3/dist/kernel/event-bus.js.map +1 -1
  181. package/v3/dist/kernel/interfaces.d.ts +35 -0
  182. package/v3/dist/kernel/interfaces.d.ts.map +1 -1
  183. package/v3/dist/kernel/kernel.d.ts.map +1 -1
  184. package/v3/dist/kernel/kernel.js +14 -17
  185. package/v3/dist/kernel/kernel.js.map +1 -1
  186. package/v3/dist/kernel/unified-memory.d.ts +5 -0
  187. package/v3/dist/kernel/unified-memory.d.ts.map +1 -1
  188. package/v3/dist/kernel/unified-memory.js +28 -0
  189. package/v3/dist/kernel/unified-memory.js.map +1 -1
  190. package/v3/dist/learning/asymmetric-learning.d.ts +133 -0
  191. package/v3/dist/learning/asymmetric-learning.d.ts.map +1 -0
  192. package/v3/dist/learning/asymmetric-learning.js +170 -0
  193. package/v3/dist/learning/asymmetric-learning.js.map +1 -0
  194. package/v3/dist/learning/pattern-lifecycle.d.ts +26 -0
  195. package/v3/dist/learning/pattern-lifecycle.d.ts.map +1 -1
  196. package/v3/dist/learning/pattern-lifecycle.js +83 -0
  197. package/v3/dist/learning/pattern-lifecycle.js.map +1 -1
  198. package/v3/dist/learning/qe-patterns.d.ts +8 -0
  199. package/v3/dist/learning/qe-patterns.d.ts.map +1 -1
  200. package/v3/dist/learning/qe-patterns.js.map +1 -1
  201. package/v3/dist/learning/real-qe-reasoning-bank.d.ts +28 -0
  202. package/v3/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -1
  203. package/v3/dist/learning/real-qe-reasoning-bank.js +72 -4
  204. package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
  205. package/v3/dist/learning/token-tracker.d.ts +22 -0
  206. package/v3/dist/learning/token-tracker.d.ts.map +1 -1
  207. package/v3/dist/learning/token-tracker.js +67 -0
  208. package/v3/dist/learning/token-tracker.js.map +1 -1
  209. package/v3/dist/mcp/bundle.js +11099 -4879
  210. package/v3/dist/mcp/tool-registry.d.ts.map +1 -1
  211. package/v3/dist/mcp/tool-registry.js +4 -0
  212. package/v3/dist/mcp/tool-registry.js.map +1 -1
  213. package/v3/dist/mcp/tools/analysis/token-usage.d.ts +1 -1
  214. package/v3/dist/mcp/tools/analysis/token-usage.d.ts.map +1 -1
  215. package/v3/dist/mcp/tools/analysis/token-usage.js +23 -3
  216. package/v3/dist/mcp/tools/analysis/token-usage.js.map +1 -1
  217. package/v3/dist/mcp/tools/base.d.ts.map +1 -1
  218. package/v3/dist/mcp/tools/base.js +1 -15
  219. package/v3/dist/mcp/tools/base.js.map +1 -1
  220. package/v3/dist/mcp/tools/coverage-analysis/index.d.ts +7 -0
  221. package/v3/dist/mcp/tools/coverage-analysis/index.d.ts.map +1 -1
  222. package/v3/dist/mcp/tools/coverage-analysis/index.js +30 -0
  223. package/v3/dist/mcp/tools/coverage-analysis/index.js.map +1 -1
  224. package/v3/dist/optimization/token-optimizer-service.d.ts +7 -0
  225. package/v3/dist/optimization/token-optimizer-service.d.ts.map +1 -1
  226. package/v3/dist/optimization/token-optimizer-service.js +10 -1
  227. package/v3/dist/optimization/token-optimizer-service.js.map +1 -1
  228. package/v3/dist/shared/types/index.d.ts +20 -1
  229. package/v3/dist/shared/types/index.d.ts.map +1 -1
  230. package/v3/dist/shared/types/index.js +1 -0
  231. package/v3/dist/shared/types/index.js.map +1 -1
  232. package/v3/dist/strange-loop/healing-controller.d.ts.map +1 -1
  233. package/v3/dist/strange-loop/healing-controller.js +12 -0
  234. package/v3/dist/strange-loop/healing-controller.js.map +1 -1
  235. package/v3/dist/strange-loop/strange-loop.d.ts +14 -0
  236. package/v3/dist/strange-loop/strange-loop.d.ts.map +1 -1
  237. package/v3/dist/strange-loop/strange-loop.js +24 -0
  238. package/v3/dist/strange-loop/strange-loop.js.map +1 -1
  239. package/v3/dist/strange-loop/types.d.ts +2 -2
  240. package/v3/dist/strange-loop/types.d.ts.map +1 -1
  241. package/v3/dist/strange-loop/types.js.map +1 -1
  242. package/v3/dist/sync/claude-flow-bridge.d.ts.map +1 -1
  243. package/v3/dist/sync/claude-flow-bridge.js +3 -24
  244. package/v3/dist/sync/claude-flow-bridge.js.map +1 -1
  245. package/v3/package.json +12 -9
  246. /package/{v3/assets/skills/sfdipot-product-factors/skill.md → .claude/skills/sfdipot-product-factors/SKILL.md} +0 -0
  247. /package/{v3/assets/skills/test-idea-rewriting/skill.md → .claude/skills/test-idea-rewriting/SKILL.md} +0 -0
@@ -0,0 +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.sh
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.