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 2022/11/05 09:56:43 UTC
[camel] branch main updated: chore(vertx-http-cleanup): replace deprecated methods (#8665)
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 5f0d8878913 chore(vertx-http-cleanup): replace deprecated methods (#8665)
5f0d8878913 is described below
commit 5f0d8878913e323e68fba73c4a69a97c06e61bd8
Author: Luca Burgazzoli <lb...@users.noreply.github.com>
AuthorDate: Sat Nov 5 10:56:37 2022 +0100
chore(vertx-http-cleanup): replace deprecated methods (#8665)
---
.../org/apache/camel/component/vertx/http/VertxHttpHelper.java | 3 +--
.../component/vertx/http/VertxHttpSendDynamicAwareTest.java | 10 ++++++----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpHelper.java b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpHelper.java
index 842ca79ddf4..1d003544f36 100644
--- a/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpHelper.java
+++ b/components/camel-vertx/camel-vertx-http/src/main/java/org/apache/camel/component/vertx/http/VertxHttpHelper.java
@@ -27,7 +27,6 @@ import java.net.URISyntaxException;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePropertyKey;
import org.apache.camel.Message;
-import org.apache.camel.http.base.HttpHelper;
import org.apache.camel.util.IOHelper;
import org.apache.camel.util.ObjectHelper;
import org.apache.camel.util.UnsafeUriCharactersEncoder;
@@ -139,7 +138,7 @@ public final class VertxHttpHelper {
String charset = null;
if (exchange != null) {
String contentType = exchange.getMessage().getHeader(VertxHttpConstants.CONTENT_TYPE, String.class);
- charset = HttpHelper.getCharsetFromContentType(contentType);
+ charset = IOHelper.getCharsetNameFromContentType(contentType);
if (ObjectHelper.isEmpty(charset)) {
charset = exchange.getProperty(ExchangePropertyKey.CHARSET_NAME, String.class);
}
diff --git a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpSendDynamicAwareTest.java b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpSendDynamicAwareTest.java
index 065425d159b..e2a34aba9aa 100644
--- a/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpSendDynamicAwareTest.java
+++ b/components/camel-vertx/camel-vertx-http/src/test/java/org/apache/camel/component/vertx/http/VertxHttpSendDynamicAwareTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.vertx.http;
import org.apache.camel.RoutesBuilder;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.support.NormalizedUri;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -33,13 +34,14 @@ public class VertxHttpSendDynamicAwareTest extends VertxHttpTestSupport {
out = fluentTemplate.to("direct:joes").withHeader("drink", "wine").request(String.class);
assertEquals("Drinking wine", out);
+ NormalizedUri uri = NormalizedUri
+ .newNormalizedUri("vertx-http://http://localhost:" + getPort() + "?throwExceptionOnFailure=false", false);
+
// and there should only be one http endpoint as they are both on same host
- boolean found = context.getEndpointMap()
- .containsKey("vertx-http://http://localhost:" + getPort() + "?throwExceptionOnFailure=false");
- assertTrue(found, "Should find static uri");
+ assertTrue(context.getEndpointRegistry().containsKey(uri), "Should find static uri");
// we only have 2xdirect and 2xVERTX-http
- assertEquals(4, context.getEndpointMap().size());
+ assertEquals(4, context.getEndpointRegistry().size());
}
@Override