citrus icon indicating copy to clipboard operation
citrus copied to clipboard

How to concat a single quote with citrus:concat?

Open chokdee opened this issue 7 years ago • 4 comments

Citrus Version 2.7.1

Question How to concat a single quote with citrus:concat?

What I've tried so far

<create-variables>
   <variable  name="sql" value="citrus:concat( 'select from xx where id='', ''' )"/>
</create-variables>

The second value with a single quote isn't concated to the first string. How can I do this?

Additional information

chokdee avatar Oct 09 '18 14:10 chokdee

Hi!

I've investigated the issue. Currently this is a bug unfortunately. There is a pretty ugly workaround to make the single quote concatenation work use ''''' instead of '''.

So you could fix your test with the provided hotfix but I'll definitely change this logic in future releases. Do you have many test cases where this issue occurs?

BR, Sven

svettwer avatar Oct 09 '18 16:10 svettwer

Developer note:

The issue occurs in the class FunctionParameterHelper, because the method cutOffSingleQuotes is called twice.

svettwer avatar Oct 09 '18 16:10 svettwer

Hi Sven the workaround is working. I will change it and hope for a fix in the future

chokdee avatar Oct 10 '18 06:10 chokdee

Hi!

There will be a fix for sure. I just can't provide a timeline. :wink:

BR, Sven

svettwer avatar Oct 10 '18 06:10 svettwer