You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2014/08/14 12:06:15 UTC
[jira] [Resolved] (CAMEL-7693) PropertyPlaceholder fails when
string contains three consecutive curly brackets
[ https://issues.apache.org/jira/browse/CAMEL-7693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang resolved CAMEL-7693.
---------------------------------
Resolution: Won't Fix
It's not a bug from my point of view.
> PropertyPlaceholder fails when string contains three consecutive curly brackets
> --------------------------------------------------------------------------------
>
> Key: CAMEL-7693
> URL: https://issues.apache.org/jira/browse/CAMEL-7693
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 2.13.2
> Reporter: MEL
> Assignee: Willem Jiang
> Priority: Trivial
>
> I've attempted to update my Camel project from version 2.13.1 to 2.13.2, however my unit tests now fail due to the way in which the PropertiesComponent now treats three curly brackets that are in a JSON string I am building using property values.
> E.g.: I have this in my route definition :-
> {code}
> <setBody>
> <simple>{"batch_item":{"item_id": "${header.commaItemId}", "algorithm_id": "{{comma_algorithm_name}}", "parameters": { "v1": "true" }}}</simple>
> </setBody>
> {code}
> Note: I can work around the issue if I separate the curly consecutive brackets with spaces.
> Test case to replicate
> {code}
> public class PropertiesComponentSimpleLanguageTest extends
> ContextTestSupport {
> ......
> public void testPropertiesComponentDualSimpleLanguage_MEL() throws Exception {
> context.addRoutes(new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> String jsonTestString = "{\"prefsObj\": {\"person\":\"${body}\", \"likesObj\": {\"itemA\":\"{{cheese.quote}}\", \"itemB\":\"{{cheese.type}}\"}}}";
> // String jsonTestString = "{\"prefsObj\": {\"person\":\"${body}\", \"likesObj\": {\"itemA\":\"{{cheese.quote}}\", \"itemB\":\"{{cheese.type}}\"} } }";
> from("direct:start").transform().simple(jsonTestString);
> }
> });
> context.start();
> String reply = template.requestBody("direct:start", "Claus", String.class);
> // assertEquals("{\"prefsObj\": {\"person\":\"Claus\", \"likesObj\": {\"itemA\":\"Camel rocks\", \"itemB\":\"Gouda\"} } }", reply);
> assertEquals("{\"prefsObj\": {\"person\":\"Claus\", \"likesObj\": {\"itemA\":\"Camel rocks\", \"itemB\":\"Gouda\"}}}", reply);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)