You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/02/18 09:13:36 UTC

[camel] branch main created (now 96f5d8d)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git.


      at 96f5d8d  CAMEL-17308: Remove verb as an allowed CAMEL REST YAML element.

This branch includes the following new commits:

     new 0e34c69  CAMEL-17658 camel-debezium: additionalProperties are trimmed (#6960)
     new 96f5d8d  CAMEL-17308: Remove verb as an allowed CAMEL REST YAML element.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[camel] 02/02: CAMEL-17308: Remove verb as an allowed CAMEL REST YAML element.

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 96f5d8d004863776de29e791b3ef390ecfc59df6
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 18 09:43:35 2022 +0100

    CAMEL-17308: Remove verb as an allowed CAMEL REST YAML element.
---
 .../src/generated/java/org/apache/camel/xml/in/ModelParser.java        | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
index 0641583..46b8d5f 100644
--- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
+++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java
@@ -2840,9 +2840,6 @@ public class ModelParser extends BaseParser {
             return true;
         };
     }
-    protected VerbDefinition doParseVerbDefinition() throws IOException, XmlPullParserException {
-        return doParse(new VerbDefinition(), verbDefinitionAttributeHandler(), verbDefinitionElementHandler(), noValueHandler());
-    }
     protected RestOperationParamDefinition doParseRestOperationParamDefinition() throws IOException, XmlPullParserException {
         return doParse(new RestOperationParamDefinition(), (def, key, val) -> {
             switch (key) {

[camel] 01/02: CAMEL-17658 camel-debezium: additionalProperties are trimmed (#6960)

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0e34c69a897e519f8ae6735bb520a1bca6d0c86d
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 18 09:43:21 2022 +0100

    CAMEL-17658 camel-debezium: additionalProperties are trimmed (#6960)
---
 .../PropertyBindingSupportMapKeyWithDotTest.java   | 45 ++++++++++++++++++++++
 .../camel/support/PropertyBindingSupport.java      | 11 +-----
 2 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportMapKeyWithDotTest.java b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportMapKeyWithDotTest.java
index af172d6..2653877 100644
--- a/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportMapKeyWithDotTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/support/PropertyBindingSupportMapKeyWithDotTest.java
@@ -36,6 +36,8 @@ public class PropertyBindingSupportMapKeyWithDotTest extends ContextTestSupport
         prop.put("id", "123");
         prop.put("database.name", "MySQL");
         prop.put("database.timezone", "CET");
+        prop.put("database.client.id", "123");
+        prop.put("database.client.type", "Basic");
 
         Map<String, String> map = new HashMap<>();
         PropertyBindingSupport.build().bind(context, map, prop);
@@ -43,6 +45,49 @@ public class PropertyBindingSupportMapKeyWithDotTest extends ContextTestSupport
         assertEquals("123", map.get("id"));
         assertEquals("MySQL", map.get("database.name"));
         assertEquals("CET", map.get("database.timezone"));
+        assertEquals("123", map.get("database.client.id"));
+        assertEquals("Basic", map.get("database.client.type"));
+    }
+
+    @Test
+    public void testPropertiesConfigMap() throws Exception {
+        Map<String, Object> prop = new LinkedHashMap<>();
+        prop.put("id", "123");
+        prop.put("config.database.name", "MySQL");
+        prop.put("config.database.timezone", "CET");
+        prop.put("config.database.client.id", "123");
+        prop.put("config.database.client.type", "Basic");
+
+        Foo foo = new Foo();
+        PropertyBindingSupport.build().bind(context, foo, prop);
+
+        assertEquals("123", foo.getId());
+        assertEquals("MySQL", foo.getConfig().get("database.name"));
+        assertEquals("CET", foo.getConfig().get("database.timezone"));
+        assertEquals("123", foo.getConfig().get("database.client.id"));
+        assertEquals("Basic", foo.getConfig().get("database.client.type"));
+    }
+
+    public static class Foo {
+
+        private String id;
+        private Map<String, String> config;
+
+        public String getId() {
+            return id;
+        }
+
+        public void setId(String id) {
+            this.id = id;
+        }
+
+        public Map<String, String> getConfig() {
+            return config;
+        }
+
+        public void setConfig(Map<String, String> config) {
+            this.config = config;
+        }
     }
 
 }
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index b0068e5..5f993d8 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -34,7 +34,6 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.stream.Collectors;
-import java.util.stream.IntStream;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.ExtendedCamelContext;
@@ -337,14 +336,8 @@ public final class PropertyBindingSupport {
                 // prepare for next iterator
                 newTarget = prop;
                 newClass = newTarget.getClass();
-                //do not ignore remaining parts, which was not traversed
-                if (parts.length > 1 && i < parts.length - 2) {
-                    newName = IntStream.range(i + 1, parts.length)
-                            .mapToObj(j -> parts[j])
-                            .collect(Collectors.joining("."));
-                } else {
-                    newName = parts[i + 1];
-                }
+                // do not ignore remaining parts, which was not traversed
+                newName = Arrays.stream(parts, i + 1, parts.length).collect(Collectors.joining("."));
                 // if we have not yet found a configurer for the new target
                 if (configurer == null) {
                     configurer = PropertyConfigurerHelper.resolvePropertyConfigurer(camelContext, newTarget);