You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2018/07/09 08:20:19 UTC

[camel] branch camel-2.21.x updated (6a1235b -> 9ccd726)

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

davsclaus pushed a change to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 6a1235b  CAMEL-12503 : support for propagating camel headers to kafka and vice versa
     new d1075e0  CAMEL-12594 repro
     new 9ccd726  CAMEL-12594: Fixed rest producer header name substitution issue. Thanks to Leonid Remennik for reporting.

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.


Summary of changes:
 .../org/apache/camel/component/rest/RestProducer.java  |  2 +-
 .../apache/camel/component/rest/RestProducerTest.java  | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)


[camel] 02/02: CAMEL-12594: Fixed rest producer header name substitution issue. Thanks to Leonid Remennik for reporting.

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

davsclaus pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 9ccd72669f3eec4cb1e8102c95573bee8bfe052b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jul 9 10:14:13 2018 +0200

    CAMEL-12594: Fixed rest producer header name substitution issue. Thanks to Leonid Remennik for reporting.
---
 .../src/main/java/org/apache/camel/component/rest/RestProducer.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestProducer.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestProducer.java
index 0da7ab4..0ca0cc8 100644
--- a/camel-core/src/main/java/org/apache/camel/component/rest/RestProducer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestProducer.java
@@ -406,7 +406,7 @@ public class RestProducer extends DefaultAsyncProducer {
                         }
                         String value = inMessage.getHeader(key, String.class);
                         if (value != null) {
-                            params.put(key, value);
+                            params.put(entry.getKey(), value);
                         } else if (!optional) {
                             // value is null and parameter is not optional
                             params.put(entry.getKey(), entry.getValue());


[camel] 01/02: CAMEL-12594 repro

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

davsclaus pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d1075e082e146a1d7e8e3b2dd70c9efde65a5e20
Author: leonidr <le...@gmail.com>
AuthorDate: Thu Jul 5 15:27:50 2018 +0300

    CAMEL-12594 repro
    
    CAMEL-12594 repro
---
 .../apache/camel/component/rest/RestProducerTest.java  | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/camel-core/src/test/java/org/apache/camel/component/rest/RestProducerTest.java b/camel-core/src/test/java/org/apache/camel/component/rest/RestProducerTest.java
index 0145e2b..50ce942 100644
--- a/camel-core/src/test/java/org/apache/camel/component/rest/RestProducerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/rest/RestProducerTest.java
@@ -40,17 +40,17 @@ public class RestProducerTest {
     public void shouldCreateOptionalPlaceholderQueryParametersForPresentValues()
         throws UnsupportedEncodingException, URISyntaxException {
         final DefaultMessage message = new DefaultMessage(camelContext);
-        message.setHeader("param", "header");
+        message.setHeader("paramPlaceholderName", "paramValue");
 
-        assertEquals("param=header", RestProducer.createQueryParameters("param={param?}", message));
+        assertEquals("param=paramValue", RestProducer.createQueryParameters("param={paramPlaceholderName?}", message));
     }
 
     @Test
     public void shouldCreatePlaceholderQueryParameters() throws UnsupportedEncodingException, URISyntaxException {
         final DefaultMessage message = new DefaultMessage(camelContext);
-        message.setHeader("param", "header");
+        message.setHeader("paramPlaceholderName", "paramValue");
 
-        assertEquals("param=header", RestProducer.createQueryParameters("param={param}", message));
+        assertEquals("param=paramValue", RestProducer.createQueryParameters("param={paramPlaceholderName}", message));
     }
 
     @Test
@@ -63,17 +63,17 @@ public class RestProducerTest {
         throws UnsupportedEncodingException, URISyntaxException {
         final DefaultMessage message = new DefaultMessage(camelContext);
 
-        assertEquals("", RestProducer.createQueryParameters("param={param?}", message));
+        assertEquals("", RestProducer.createQueryParameters("param={paramPlaceholderName?}", message));
     }
 
     @Test
     public void shouldSupportAllCombinations() throws UnsupportedEncodingException, URISyntaxException {
         final DefaultMessage message = new DefaultMessage(camelContext);
-        message.setHeader("required", "header_required");
-        message.setHeader("optional_present", "header_optional_present");
+        message.setHeader("requiredParamPlaceholder", "header_required_value");
+        message.setHeader("optionalPresentParamPlaceholder", "header_optional_present_value");
 
-        assertEquals("given=value&required=header_required&optional_present=header_optional_present",
+        assertEquals("given=value&required=header_required_value&optional_present=header_optional_present_value",
             RestProducer.createQueryParameters(
-                "given=value&required={required}&optional={optional?}&optional_present={optional_present?}", message));
+                "given=value&required={requiredParamPlaceholder}&optional={optionalParamPlaceholder?}&optional_present={optionalPresentParamPlaceholder?}", message));
     }
 }