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:18 UTC

[camel] branch camel-2.22.x updated (63cf5f9 -> a232dfa)

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

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


    from 63cf5f9  CAMEL-12610 Fixed the issue of camel bean always invokes cached instance
     new 262d0ac  CAMEL-12594 repro
     new a232dfa  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.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a232dfafade3c9ec087ea5e677a8edc7f004156d
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 ea7fc12..83b36cc 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.22.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 262d0ac37dc12de095e0eadd76e205d2ca4decbb
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));
     }
 }