davsclaus opened a new pull request, #29394: URL: https://github.com/apache/camel/pull/29394
## Description [CAMEL-26724](https://issues.apache.org/jira/browse/CAMEL-26724): W-3 of the stage 2 decisions on CAMEL-26607, chaos in a test, so a finding of a chaos session becomes a regression test. `ChaosAssertions` in camel-chaos (public, `@since 4.24`): - `assertVerdict(context, verdict, timeout)` waits until the report is final (no expectation pending), then checks the verdict; `assertVerdict(context, verdict)` checks it now and fails when the report is not final. - `assertExpectationMet(context, ruleId, timeout)` waits until the expectation of the rule is decided (pending → met or unmet). - `assertFired(context, ruleId, atLeast)` checks the faults of a rule (one that fires 0 times is often a typo). - `awaitFinalReport(context, timeout)` returns the final report for other checks. They throw an `AssertionError` with the reason and the report as text, so they work with any test framework: camel-test does not depend on camel-chaos. Chaos is switched on in a test with `camel.chaos.enabled=true`, `camel.chaos.seed` and `camel.chaos.rules` (or a scenario, or `ChaosManager.addRule`). Decided and left out (in the JIRA): a JUnit annotation for the rules (camel-test would then depend on camel-chaos), and a Citrus action for `camel test run` (it belongs in Citrus). Docs: a new "Chaos in a test" section of the camel-chaos page with a `CamelTestSupport` test (and its catalog copy), and a line in `design/chaos.adoc`. ## Tests - `ChaosAssertionsTest`: a retried fault passes with the expectation met; a lost message fails with the reason and the report; a pending report is not final in time; a rule that fired too little, a rule without an expectation, an unknown rule, chaos off. - camel-chaos: 773 green. _Claude Code on behalf of Claus Ibsen_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
