Closed andy-d2019 closed 6 months ago
Yes, this is because Citrus test variables and Camel simple language both use the same syntax '${}' for expressions.
You have two options here:
YAKS_CAMELK_SUPPORT_VARIABLES_IN_SOURCES
to false
- this will prevent Citrus from parsing the expressions in Camel K resources$simple{ }
in your Camel logic (e.g. $simple{body}
)This should go into the YAKS documentation 😄
2. Use the alternative simple language syntax
$simple{ }
in your Camel logic (e.g.$simple{body}
)
Just to make sure, so this would be
set-property:
name: data
simple: "$simple{body}"
?
If yes, a PR for the docs would be my pleasure.
Thanks for the quick responses, this will make the Kamelet a lot more readable again 😄
Closing this one as it seems to have clarified. Thx!
Given the following Syntax in a Kamelet running with Camel-K 2.1.0
If i use
Kamelet load
on the given Kamelet in a yaks test.feature file and run it with yaks run i get an exception of the formorg.citrusframework.exceptions.TestCaseFailedException: Unknown variable 'body'
Without Yaks the Kamelet runs perfectly fine by itself, but it seems like Yaks/Citrus try to interpret the variable in the simple-language block as their own variable.
I could find a workaround by escaping the dollar sign with '\u0024'. Other common yaml escape sequences do not seem to work.