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 2023/08/29 05:17:51 UTC

[camel] 01/02: Fix CS

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

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

commit 0c4855e7d3db540ee2ad57c10ff76a4e8971f77c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 29 07:16:06 2023 +0200

    Fix CS
---
 .../org/apache/camel/component/netty/http/NettyHttpEndpoint.java | 3 +--
 .../component/netty/http/NettyHttpProducerProxyModeTest.java     | 9 ++++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
index 172143816c4..d489554a5d8 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
@@ -50,7 +50,6 @@ import org.slf4j.LoggerFactory;
 public class NettyHttpEndpoint extends NettyEndpoint implements AsyncEndpoint, HeaderFilterStrategyAware {
 
     private static final Logger LOG = LoggerFactory.getLogger(NettyHttpEndpoint.class);
-    static final String PROXY_NOT_SUPPORTED_MESSAGE = "Netty Http Producer does not support proxy mode";
 
     @UriParam
     private NettyHttpConfiguration configuration;
@@ -106,7 +105,7 @@ public class NettyHttpEndpoint extends NettyEndpoint implements AsyncEndpoint, H
     @Override
     public Producer createProducer() throws Exception {
         if (isProxyProtocol()) {
-            doFail(new IllegalArgumentException(PROXY_NOT_SUPPORTED_MESSAGE));
+            doFail(new IllegalArgumentException("Netty Http Producer does not support proxy mode"));
         }
 
         Producer answer = new NettyHttpProducer(this, getConfiguration());
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerProxyModeTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerProxyModeTest.java
index 6d56debcee3..3612e392959 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerProxyModeTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerProxyModeTest.java
@@ -22,20 +22,19 @@ import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
-import static org.apache.camel.component.netty.http.NettyHttpEndpoint.PROXY_NOT_SUPPORTED_MESSAGE;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class NettyHttpProducerProxyModeTest extends CamelTestSupport {
 
+    private final int port = AvailablePortFinder.getNextAvailable();
+
     @Override
     public boolean isUseRouteBuilder() {
         return false;
     }
 
-    private static final int port = AvailablePortFinder.getNextAvailable();
-
     @Test
     public void testProxyNotSupported() throws Exception {
 
@@ -51,9 +50,9 @@ public class NettyHttpProducerProxyModeTest extends CamelTestSupport {
 
         FailedToStartRouteException thrown = assertThrows(FailedToStartRouteException.class, () -> {
             context.start();
-        }, PROXY_NOT_SUPPORTED_MESSAGE);
+        }, "Netty Http Producer does not support proxy mode");
 
         assertNotNull(thrown.getMessage());
-        assertTrue(thrown.getMessage().contains(PROXY_NOT_SUPPORTED_MESSAGE));
+        assertTrue(thrown.getMessage().contains("Netty Http Producer does not support proxy mode"));
     }
 }