This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 7e8bebd Fixed test
7e8bebd is described below
commit 7e8bebd396cd353e5d76a3b820d7128fdce3a567
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Oct 14 09:09:33 2020 +0200
Fixed test
---
.../component/http/HttpEndpointUriAssemblerTest.java | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git
a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpEndpointUriAssemblerTest.java
b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpEndpointUriAssemblerTest.java
index 0c73611..2901b9d 100644
---
a/components/camel-http/src/test/java/org/apache/camel/component/http/HttpEndpointUriAssemblerTest.java
+++
b/components/camel-http/src/test/java/org/apache/camel/component/http/HttpEndpointUriAssemblerTest.java
@@ -19,9 +19,10 @@ package org.apache.camel.component.http;
import java.util.HashMap;
import java.util.Map;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.spi.EndpointUriFactory;
-import org.apache.camel.util.URISupport;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -40,15 +41,20 @@ public class HttpEndpointUriAssemblerTest {
params.put("proxyAuthPassword", "pwd");
// should find the source code generated assembler via classpath
- EndpointUriFactory assembler = new
DefaultCamelContext().getEndpointUriFactory("https");
+ CamelContext context = new DefaultCamelContext();
+ context.start();
+
+ EndpointUriFactory assembler =
context.adapt(ExtendedCamelContext.class).getEndpointUriFactory("https");
assertNotNull(assembler);
assertTrue(assembler instanceof HttpEndpointUriFactory);
- Map<String, Object> query =
URISupport.parseQuery(assembler.buildUri("https", params));
- assertEquals(query.get("proxyAuthUsername"), "RAW(usr)");
- assertEquals(query.get("proxyAuthPassword"), "RAW(pwd)");
- assertEquals(query.get("proxyAuthHost"), "myotherproxy");
- assertEquals(query.get("proxyAuthPort"), "2345");
+ String uri = assembler.buildUri("https", params);
+ assertNotNull(uri);
+ assertEquals(
+
"https:www.google.com?proxyAuthHost=myotherproxy&proxyAuthPassword=RAW(pwd)&proxyAuthPort=2345&proxyAuthUsername=RAW(usr)",
+ uri);
+
+ context.stop();
}
}