davsclaus commented on PR #26824:
URL: https://github.com/apache/camel/pull/26824#issuecomment-5811451160

   Fixed in `60a703a94f9c` — the finding was right and the bug was mine.
   
   `operator.toString().replace("=", "!=")` replaces each `=` on its own, so 
`==` became `!=!=` and the message named an operator that does not exist. 
`negatedOperator()` was already there, one line below, and is used for it now.
   
   Checking that helper turned up the same fault in its fallback: `"!" + text` 
gives `!>` for a comparison, which is also not an operator. So only the eleven 
that have a negated form answer one, and the comparisons answer null:
   
   ```
   !${body} == 'x'        -> ... not a comparison: write ${...} != value
   !${body} > 5           -> ... not a comparison: compare the other way round
   !${body} contains 'x'  -> ... not a comparison: write ${...} !contains value
   !${body} in 'a,b'      -> ... not a comparison: write ${...} !in value
   ```
   
   My test asserted only that the message began with `! cannot be compared`, 
which is exactly why it sailed past this. It now asserts the operator the 
message names, and that `!=!=` does not appear.
   
   610 `Simple*` tests pass.
   
   One note on the earlier red build here: it was `RestProducerPathTest` 
failing, which came from CAMEL-24986 leaking into my local repository, not from 
this branch. That change is reverted in main (`7aec6a1a2b9b`) and this branch 
is clean — 632 tests across `Simple*` and `RestProducer*`.


-- 
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]

Reply via email to