You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do I create a bean in Spring and use that bean (whithout xml configuration) in Citrus as Citrus Custom Function?
Is it necessary to create a custom function or I just create a Bean In Spring and inject that into my test and use that function to convert some values?
You create that function in Citrus in order to have it resolved in any String template (e.g. message body, header and so on) like
{ "foo": "citrus:randomString()" }
now in case you like to add custom functions you can follow the XML based configuration and just use it as a Java Spring bean configuration instead. The mechanism stays exactly the same.
In general the idea is to add a new custom function library and add your custom functions to it. So you end up having
{ "foo": "custom:customFunc()" }
As an alternative to that you can add a resource type resolver for your function. For this you put a file into META-INF/citrus/function/foo and in this file you point to your custom function class like this
Citrus Version
Latest 4.0.0-M2
Question
I'm using Citrus Cucumber and JUnit5. I would like to create a custom function, and found this on the website:
https://citrusframework.org/docs/custom-functions/
What I've tried so far
I've looked at the following page: https://citrusframework.org/docs/custom-functions/
Additional information
It expects some xml configuration. And I would like to use it without any xml configuration.
The text was updated successfully, but these errors were encountered: