camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (CAMEL-7693) PropertyPlaceholder fails when string contains three consecutive curly brackets
Date Thu, 14 Aug 2014 10:06:13 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-7693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Willem Jiang reassigned CAMEL-7693:
-----------------------------------

    Assignee: Willem Jiang

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

Mime
View raw message