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 2021/12/04 06:57:03 UTC

[camel] branch main updated: CAMEL-17267 Adding httpMethod to endpoint properties (#6499)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 5d8f4f4  CAMEL-17267 Adding httpMethod to endpoint properties (#6499)
5d8f4f4 is described below

commit 5d8f4f495ed6d999aa7bd1fa639512e80584327b
Author: henka-rl <67...@users.noreply.github.com>
AuthorDate: Sat Dec 4 07:56:32 2021 +0100

    CAMEL-17267 Adding httpMethod to endpoint properties (#6499)
---
 .../src/main/java/org/apache/camel/component/http/HttpComponent.java  | 1 +
 .../java/org/apache/camel/component/http/HeaderFilteringTest.java     | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
index 8554b4f..e547b9b 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
@@ -561,6 +561,7 @@ public class HttpComponent extends HttpCommonComponent implements RestProducerFa
         // build query string, and append any endpoint configuration properties
         if (config.getProducerComponent() == null || config.getProducerComponent().equals("http")) {
             // setup endpoint options
+            map.put("httpMethod", verb);
             if (config.getEndpointProperties() != null && !config.getEndpointProperties().isEmpty()) {
                 map.putAll(config.getEndpointProperties());
             }
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/HeaderFilteringTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/HeaderFilteringTest.java
index faed11f..d190653 100644
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/HeaderFilteringTest.java
+++ b/components/camel-http/src/test/java/org/apache/camel/component/http/HeaderFilteringTest.java
@@ -38,7 +38,7 @@ import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
-import static org.apache.camel.component.http.HttpMethods.GET;
+import static org.apache.camel.component.http.HttpMethods.POST;
 import static org.apache.http.HttpHeaders.HOST;
 import static org.apache.http.entity.ContentType.APPLICATION_JSON;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -59,7 +59,7 @@ public class HeaderFilteringTest {
 
         final HttpComponent http = context.getComponent("http", HttpComponent.class);
 
-        final Producer producer = http.createProducer(context, "http://localhost:" + port, GET.name(), "/test", null, null,
+        final Producer producer = http.createProducer(context, "http://localhost:" + port, POST.name(), "/test", null, null,
                 APPLICATION_JSON.getMimeType(), APPLICATION_JSON.getMimeType(), new RestConfiguration(),
                 Collections.emptyMap());