Details
-
Bug
-
Status: Resolved
-
Trivial
-
Resolution: Won't Fix
-
2.13.2
-
None
-
None
-
Unknown
Description
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 :-
<setBody> <simple>{"batch_item":{"item_id": "${header.commaItemId}", "algorithm_id": "{{comma_algorithm_name}}", "parameters": { "v1": "true" }}}</simple> </setBody>
Note: I can work around the issue if I separate the curly consecutive brackets with spaces.
Test case to replicate
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); }
Attachments
Issue Links
- is related to
-
CAMEL-7429 Camel Properties Component concatenation issue
- Resolved