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 644f619 CAMEL-16241: Added unit test
644f619 is described below
commit 644f619b5a015801ddfb2f27bd56d72571389738
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Mar 2 10:16:50 2021 +0100
CAMEL-16241: Added unit test
---
.../apache/camel/builder/endpoint/HttpsBasicAuthTest.java | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git
a/core/camel-endpointdsl/src/test/java/org/apache/camel/builder/endpoint/HttpsBasicAuthTest.java
b/core/camel-endpointdsl/src/test/java/org/apache/camel/builder/endpoint/HttpsBasicAuthTest.java
index 1677e08..7ec754a 100644
---
a/core/camel-endpointdsl/src/test/java/org/apache/camel/builder/endpoint/HttpsBasicAuthTest.java
+++
b/core/camel-endpointdsl/src/test/java/org/apache/camel/builder/endpoint/HttpsBasicAuthTest.java
@@ -22,6 +22,8 @@ import
org.apache.camel.builder.endpoint.dsl.HttpEndpointBuilderFactory;
import org.apache.camel.component.http.HttpEndpoint;
import org.junit.jupiter.api.Test;
+import java.util.Properties;
+
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -34,6 +36,11 @@ public class HttpsBasicAuthTest extends ContextTestSupport {
@Test
public void testHttps() throws Exception {
+ Properties props = new Properties();
+ props.put("prop.username", "scott");
+ props.put("prop.password", "tiger");
+ context.getPropertiesComponent().setInitialProperties(props);
+
context.start();
context.addRoutes(new EndpointRouteBuilder() {
@@ -41,13 +48,13 @@ public class HttpsBasicAuthTest extends ContextTestSupport {
public void configure() throws Exception {
HttpEndpointBuilderFactory.HttpEndpointBuilder builder
=
https("inline").authenticationPreemptive(true).authMethod("Basic")
-
.authUsername("prop.username").authPassword("prop.password");
+
.authUsername("{{prop.username}}").authPassword("{{prop.password}}");
Endpoint endpoint = builder.resolve(context);
assertNotNull(endpoint);
HttpEndpoint he = assertIsInstanceOf(HttpEndpoint.class,
endpoint);
- assertEquals("prop.username", he.getAuthUsername());
- assertEquals("prop.password", he.getAuthPassword());
+ assertEquals("scott", he.getAuthUsername());
+ assertEquals("tiger", he.getAuthPassword());
}
});