From 5e952d9b276d03fbc070501418452f2163a29657 Mon Sep 17 00:00:00 2001
From: Andrea Cosentino
Date: Fri, 22 May 2026 18:46:15 +0200
Subject: [PATCH] [backport camel-4.14.x] CAMEL-23574: camel-dns - align
Exchange header constant names with Camel naming convention
Backport of #23411.
Rename the Exchange header string values in DnsConstants from dotted lowercase
(dns.class / dns.name / dns.domain / dns.server / dns.type / term) to the
project-wide Camel convention:
DNS_CLASS -> CamelDnsClass
DNS_NAME -> CamelDnsName
DNS_DOMAIN -> CamelDnsDomain
DNS_SERVER -> CamelDnsServer
DNS_TYPE -> CamelDnsType
TERM -> CamelDnsTerm
The Java field names are unchanged so routes and code that reference the
constants symbolically continue to work without changes. Routes that set the
headers by their literal string value must be updated.
Updates the in-module tests to go through DnsConstants (preserving the existing
4.14.x test idioms), refreshes the DnsComponent / DnsWikipediaProducer Javadoc
and the component documentation references, and regenerates the component
metadata, catalog, and endpoint DSL factory.
The version-specific upgrade-guide entry is added on the main branch (per the
backport upgrade-guide policy), not on this maintenance branch.
Reported by Claude Code on behalf of Andrea Cosentino
Signed-off-by: Andrea Cosentino
---
.../apache/camel/catalog/components/dns.json | 12 ++++-----
.../org/apache/camel/component/dns/dns.json | 12 ++++-----
.../src/main/docs/dns-component.adoc | 6 ++---
.../camel/component/dns/DnsComponent.java | 22 +++++++++-------
.../camel/component/dns/DnsConstants.java | 12 ++++-----
.../component/dns/DnsWikipediaProducer.java | 2 +-
.../dns/DnsDigEndpointSpringTest.java | 4 +--
.../component/dns/DnsDigEndpointTest.java | 4 +--
.../dns/DnsIpEndpointSpringTest.java | 6 ++---
.../component/dns/DnsIpEndpointTest.java | 6 ++---
.../dns/DnsIpHeaderTransferTest.java | 6 ++---
.../dns/DnsLookupEndpointSpringTest.java | 8 +++---
.../component/dns/DnsLookupEndpointTest.java | 8 +++---
.../dns/WikipediaEndpointSpringTest.java | 2 +-
.../component/dns/WikipediaEndpointTest.java | 2 +-
.../dsl/DnsEndpointBuilderFactory.java | 26 +++++++++----------
16 files changed, 70 insertions(+), 68 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dns.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dns.json
index b66e815b36da6..8877de935610b 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dns.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/dns.json
@@ -28,12 +28,12 @@
"autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }
},
"headers": {
- "dns.class": { "index": 0, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The DNS class of the lookup. Should match the values of org.xbill.dns.DClass. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_CLASS" },
- "dns.name": { "index": 1, "kind": "header", "displayName": "", "group": "lookup", "label": "lookup", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name to lookup", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_NAME" },
- "dns.domain": { "index": 2, "kind": "header", "displayName": "", "group": "ip", "label": "ip", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The domain name.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_DOMAIN" },
- "dns.server": { "index": 3, "kind": "header", "displayName": "", "group": "dig", "label": "dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server in particular for the query. If none is given, the default one specified by the OS will be used. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_SERVER" },
- "dns.type": { "index": 4, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup. Should match the values of org.xbill.dns.Type. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_TYPE" },
- "term": { "index": 5, "kind": "header", "displayName": "", "group": "wikipedia", "label": "wikipedia", "required": true, "javaType": "", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The term", "constantName": "org.apache.camel.component.dns.DnsConstants#TERM" }
+ "CamelDnsClass": { "index": 0, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The DNS class of the lookup. Should match the values of org.xbill.dns.DClass. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_CLASS" },
+ "CamelDnsName": { "index": 1, "kind": "header", "displayName": "", "group": "lookup", "label": "lookup", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name to lookup", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_NAME" },
+ "CamelDnsDomain": { "index": 2, "kind": "header", "displayName": "", "group": "ip", "label": "ip", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The domain name.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_DOMAIN" },
+ "CamelDnsServer": { "index": 3, "kind": "header", "displayName": "", "group": "dig", "label": "dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server in particular for the query. If none is given, the default one specified by the OS will be used. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_SERVER" },
+ "CamelDnsType": { "index": 4, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup. Should match the values of org.xbill.dns.Type. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_TYPE" },
+ "CamelDnsTerm": { "index": 5, "kind": "header", "displayName": "", "group": "wikipedia", "label": "wikipedia", "required": true, "javaType": "", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The term", "constantName": "org.apache.camel.component.dns.DnsConstants#TERM" }
},
"properties": {
"dnsType": { "index": 0, "kind": "path", "displayName": "Dns Type", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.dns.DnsType", "enum": [ "dig", "ip", "lookup", "wikipedia" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup." },
diff --git a/components/camel-dns/src/generated/resources/META-INF/org/apache/camel/component/dns/dns.json b/components/camel-dns/src/generated/resources/META-INF/org/apache/camel/component/dns/dns.json
index b66e815b36da6..8877de935610b 100644
--- a/components/camel-dns/src/generated/resources/META-INF/org/apache/camel/component/dns/dns.json
+++ b/components/camel-dns/src/generated/resources/META-INF/org/apache/camel/component/dns/dns.json
@@ -28,12 +28,12 @@
"autowiredEnabled": { "index": 1, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc." }
},
"headers": {
- "dns.class": { "index": 0, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The DNS class of the lookup. Should match the values of org.xbill.dns.DClass. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_CLASS" },
- "dns.name": { "index": 1, "kind": "header", "displayName": "", "group": "lookup", "label": "lookup", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name to lookup", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_NAME" },
- "dns.domain": { "index": 2, "kind": "header", "displayName": "", "group": "ip", "label": "ip", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The domain name.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_DOMAIN" },
- "dns.server": { "index": 3, "kind": "header", "displayName": "", "group": "dig", "label": "dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server in particular for the query. If none is given, the default one specified by the OS will be used. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_SERVER" },
- "dns.type": { "index": 4, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup. Should match the values of org.xbill.dns.Type. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_TYPE" },
- "term": { "index": 5, "kind": "header", "displayName": "", "group": "wikipedia", "label": "wikipedia", "required": true, "javaType": "", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The term", "constantName": "org.apache.camel.component.dns.DnsConstants#TERM" }
+ "CamelDnsClass": { "index": 0, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The DNS class of the lookup. Should match the values of org.xbill.dns.DClass. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_CLASS" },
+ "CamelDnsName": { "index": 1, "kind": "header", "displayName": "", "group": "lookup", "label": "lookup", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name to lookup", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_NAME" },
+ "CamelDnsDomain": { "index": 2, "kind": "header", "displayName": "", "group": "ip", "label": "ip", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The domain name.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_DOMAIN" },
+ "CamelDnsServer": { "index": 3, "kind": "header", "displayName": "", "group": "dig", "label": "dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The server in particular for the query. If none is given, the default one specified by the OS will be used. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_SERVER" },
+ "CamelDnsType": { "index": 4, "kind": "header", "displayName": "", "group": "lookup dig", "label": "lookup dig", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup. Should match the values of org.xbill.dns.Type. Optional.", "constantName": "org.apache.camel.component.dns.DnsConstants#DNS_TYPE" },
+ "CamelDnsTerm": { "index": 5, "kind": "header", "displayName": "", "group": "wikipedia", "label": "wikipedia", "required": true, "javaType": "", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The term", "constantName": "org.apache.camel.component.dns.DnsConstants#TERM" }
},
"properties": {
"dnsType": { "index": 0, "kind": "path", "displayName": "Dns Type", "group": "producer", "label": "", "required": true, "type": "enum", "javaType": "org.apache.camel.component.dns.DnsType", "enum": [ "dig", "ip", "lookup", "wikipedia" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The type of the lookup." },
diff --git a/components/camel-dns/src/main/docs/dns-component.adoc b/components/camel-dns/src/main/docs/dns-component.adoc
index c441514e555f1..7429a34362871 100644
--- a/components/camel-dns/src/main/docs/dns-component.adoc
+++ b/components/camel-dns/src/main/docs/dns-component.adoc
@@ -84,7 +84,7 @@ include::partial$component-endpoint-headers.adoc[]
This looks up a domain's IP. For example, _www.example.com_ resolves to
192.0.32.10.
-The IP address to lookup must be provided in the header with key `"dns.domain"`.
+The IP address to lookup must be provided in the header with key `"CamelDnsDomain"`.
=== DNS lookup
@@ -98,7 +98,7 @@ The IP address to lookup must be provided in the header with key `"dns.domain"`.
This returns a set of DNS records associated with a domain. +
The name to lookup must be provided in the header with key
-`"dns.name"`.
+`"CamelDnsName"`.
=== DNS Dig
@@ -112,7 +112,7 @@ Dig is a Unix command-line utility to run DNS queries.
----
-The query must be provided in the header with key `"dns.query"`.
+The query must be provided in the header with key `"CamelDnsName"`.
=== Dns Activation Policy
diff --git a/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsComponent.java b/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsComponent.java
index 48ca3461ce527..c74542bd46f60 100644
--- a/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsComponent.java
+++ b/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsComponent.java
@@ -31,25 +31,27 @@
*
* dns:///ip
*
- * This will return the IP address associated with the domain passed in the header dns.domain.
+ * This will return the IP address associated with the domain passed in the header CamelDnsDomain.
*
*
* dns:///lookup This endpoint accepts three parameters.
*
- * - dns.name: the lookup name. Usually the domain. Mandatory.
- * - dns.type: the type of the lookup. Should match the values of {@see org.xbill.dns.Type}. Optional.
- * - dns.class: the DNS class of the lookup. Should match the values of {@see org.xbill.dns.DClass}. Optional.
+ * - CamelDnsName: the lookup name. Usually the domain. Mandatory.
+ * - CamelDnsType: the type of the lookup. Should match the values of {@see org.xbill.dns.Type}. Optional.
+ * - CamelDnsClass: the DNS class of the lookup. Should match the values of {@see org.xbill.dns.DClass}.
+ * Optional.
*
*
*
*
* dns:///dig This endpoint takes a few parameters, most of them optional :
*
- * - dns.server: the server in particular for the query. If none is given, the default one specified by the OS will be
- * used.
- * - dns.query: the query itself. Mandatory.
- * - dns.type: the type of the lookup. Should match the values of {@see org.xbill.dns.Type}. Optional.
- * - dns.class: the DNS class of the lookup. Should match the values of {@see org.xbill.dns.DClass}. Optional.
+ * - CamelDnsServer: the server in particular for the query. If none is given, the default one specified by the OS
+ * will be used.
+ * - CamelDnsName: the lookup name to query. Mandatory.
+ * - CamelDnsType: the type of the lookup. Should match the values of {@see org.xbill.dns.Type}. Optional.
+ * - CamelDnsClass: the DNS class of the lookup. Should match the values of {@see org.xbill.dns.DClass}.
+ * Optional.
*
*
*
@@ -57,7 +59,7 @@
*
* dns:///wikipedia This endpoint takes one paramter :
*
- * - term: the search term on wikipedia
+ * - CamelDnsTerm: the search term on wikipedia
*
*
*
diff --git a/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsConstants.java b/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsConstants.java
index 2c934532dff4d..0c5bce4457a9c 100644
--- a/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsConstants.java
+++ b/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsConstants.java
@@ -28,21 +28,21 @@ public class DnsConstants {
@Metadata(label = "lookup dig", description = "The DNS class of the lookup. Should match the values of\n" +
"`org.xbill.dns.DClass`. Optional.",
javaType = "String")
- public static final String DNS_CLASS = "dns.class";
+ public static final String DNS_CLASS = "CamelDnsClass";
@Metadata(label = "lookup", description = "The name to lookup", javaType = "String", required = true)
- public static final String DNS_NAME = "dns.name";
+ public static final String DNS_NAME = "CamelDnsName";
@Metadata(label = "ip", description = "The domain name.", javaType = "String", required = true)
- public static final String DNS_DOMAIN = "dns.domain";
+ public static final String DNS_DOMAIN = "CamelDnsDomain";
@Metadata(label = "dig", description = "The server in particular for the query. If none is given, the default\n" +
"one specified by the OS will be used. Optional.",
javaType = "String")
- public static final String DNS_SERVER = "dns.server";
+ public static final String DNS_SERVER = "CamelDnsServer";
@Metadata(label = "lookup dig", description = "The type of the lookup. Should match the values of `org.xbill.dns.Type`.\n" +
"Optional.",
javaType = "String")
- public static final String DNS_TYPE = "dns.type";
+ public static final String DNS_TYPE = "CamelDnsType";
@Metadata(label = "wikipedia", description = "The term", required = true)
- public static final String TERM = "term";
+ public static final String TERM = "CamelDnsTerm";
protected DnsConstants() {
//Utility class
diff --git a/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsWikipediaProducer.java b/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsWikipediaProducer.java
index 7965107df2970..6caccb0edcd77 100644
--- a/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsWikipediaProducer.java
+++ b/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsWikipediaProducer.java
@@ -32,7 +32,7 @@
*
* See here for a reference: http://www.commandlinefu.com/commands/view/2829/query-wikipedia-via-console-over-dns
*
- * This endpoint accepts the following header: term: a simple term to use to query wikipedia.
+ * This endpoint accepts the following header: CamelDnsTerm: a simple term to use to query wikipedia.
*/
public class DnsWikipediaProducer extends DefaultProducer {
diff --git a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointSpringTest.java b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointSpringTest.java
index f588f338bd4f1..9c3850d501cca 100644
--- a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointSpringTest.java
+++ b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointSpringTest.java
@@ -66,8 +66,8 @@ public boolean matches(Exchange exchange) {
}
});
Map headers = new HashMap<>();
- headers.put("dns.name", "monkey.wp.dg.cx");
- headers.put("dns.type", "TXT");
+ headers.put(DnsConstants.DNS_NAME, "monkey.wp.dg.cx");
+ headers.put(DnsConstants.DNS_TYPE, "TXT");
template.sendBodyAndHeaders(null, headers);
resultEndpoint.assertIsSatisfied();
}
diff --git a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointTest.java b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointTest.java
index 31147173449de..24b7a2f424eff 100644
--- a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointTest.java
+++ b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointTest.java
@@ -71,8 +71,8 @@ public boolean matches(Exchange exchange) {
}
});
Map headers = new HashMap<>();
- headers.put("dns.name", "monkey.wp.dg.cx");
- headers.put("dns.type", "TXT");
+ headers.put(DnsConstants.DNS_NAME, "monkey.wp.dg.cx");
+ headers.put(DnsConstants.DNS_TYPE, "TXT");
template.sendBodyAndHeaders(null, headers);
resultEndpoint.assertIsSatisfied();
}
diff --git a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointSpringTest.java b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointSpringTest.java
index 93f88f62f17f5..02503fc6646bb 100644
--- a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointSpringTest.java
+++ b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointSpringTest.java
@@ -44,7 +44,7 @@ public class DnsIpEndpointSpringTest extends CamelSpringTestSupport {
void testNullIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
try {
- template.sendBodyAndHeader("hello", "dns.domain", null);
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, null);
fail("Should have thrown exception");
} catch (Exception t) {
assertTrue(t.getCause() instanceof IllegalArgumentException);
@@ -56,7 +56,7 @@ void testNullIPRequests() throws Exception {
void testEmptyIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
try {
- template.sendBodyAndHeader("hello", "dns.domain", "");
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "");
fail("Should have thrown exception");
} catch (Exception t) {
assertTrue(t.getCause() instanceof IllegalArgumentException);
@@ -71,7 +71,7 @@ void testValidIPRequests() throws Exception {
resultEndpoint.expectedBodiesReceived("40.79.78.1");
- template.sendBodyAndHeader("hello", "dns.domain", "www.apache.org");
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "www.apache.org");
resultEndpoint.assertIsSatisfied();
}
diff --git a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointTest.java b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointTest.java
index 91a2c0eba20bf..e0acfe4473907 100644
--- a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointTest.java
+++ b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointTest.java
@@ -53,7 +53,7 @@ public void configure() {
void testNullIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
try {
- template.sendBodyAndHeader("hello", "dns.domain", null);
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, null);
fail("Should have thrown exception");
} catch (Exception t) {
assertTrue(t.getCause() instanceof IllegalArgumentException);
@@ -65,7 +65,7 @@ void testNullIPRequests() throws Exception {
void testEmptyIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
try {
- template.sendBodyAndHeader("hello", "dns.domain", "");
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "");
fail("Should have thrown exception");
} catch (Exception t) {
assertTrue(t.getCause() instanceof IllegalArgumentException);
@@ -80,7 +80,7 @@ void testValidIPRequests() throws Exception {
resultEndpoint.expectedBodiesReceived("40.79.78.1");
- template.sendBodyAndHeader("hello", "dns.domain", "www.apache.org");
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "www.apache.org");
resultEndpoint.assertIsSatisfied();
}
}
diff --git a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpHeaderTransferTest.java b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpHeaderTransferTest.java
index da712b107db63..988d3f454f368 100644
--- a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpHeaderTransferTest.java
+++ b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpHeaderTransferTest.java
@@ -51,7 +51,7 @@ void testNullIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
try {
- template.sendBodyAndHeader("hello", "dns.domain", null);
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, null);
fail("Should have thrown exception");
} catch (Exception t) {
assertTrue(t.getCause() instanceof IllegalArgumentException);
@@ -64,7 +64,7 @@ void testEmptyIPRequests() throws Exception {
resultEndpoint.expectedMessageCount(0);
try {
- template.sendBodyAndHeader("hello", "dns.domain", "");
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "");
fail("Should have thrown exception");
} catch (Exception t) {
assertTrue(t.getCause() instanceof IllegalArgumentException);
@@ -80,7 +80,7 @@ void testValidIPRequests() throws Exception {
resultEndpoint.expectedBodiesReceived("40.79.78.1");
resultEndpoint.expectedHeaderReceived("foo", "bar");
- template.sendBodyAndHeader("hello", "dns.domain", "www.apache.org");
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_DOMAIN, "www.apache.org");
resultEndpoint.assertIsSatisfied();
}
}
diff --git a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointSpringTest.java b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointSpringTest.java
index 8e88cab02d97b..947f8b9465969 100644
--- a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointSpringTest.java
+++ b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointSpringTest.java
@@ -62,7 +62,7 @@ void testDNSWithNoHeaders() throws Exception {
void testDNSWithEmptyNameHeader() throws Exception {
resultEndpoint.expectedMessageCount(0);
try {
- template.sendBodyAndHeader("hello", "dns.name", "");
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_NAME, "");
fail("Should have thrown exception");
} catch (Exception t) {
assertTrue(t.getCause() instanceof IllegalArgumentException, t.toString());
@@ -81,7 +81,7 @@ public boolean matches(Exchange exchange) {
}
});
Map headers = new HashMap<>();
- headers.put("dns.name", "www.example.com");
+ headers.put(DnsConstants.DNS_NAME, "www.example.com");
template.sendBodyAndHeaders("hello", headers);
resultEndpoint.assertIsSatisfied();
}
@@ -97,8 +97,8 @@ public boolean matches(Exchange exchange) {
}
});
Map headers = new HashMap<>();
- headers.put("dns.name", "www.example.com");
- headers.put("dns.type", "A");
+ headers.put(DnsConstants.DNS_NAME, "www.example.com");
+ headers.put(DnsConstants.DNS_TYPE, "A");
template.sendBodyAndHeaders("hello", headers);
resultEndpoint.assertIsSatisfied();
}
diff --git a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointTest.java b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointTest.java
index fd21dae427974..069a40c68e6b4 100644
--- a/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointTest.java
+++ b/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointTest.java
@@ -71,7 +71,7 @@ void testDNSWithNoHeaders() throws Exception {
void testDNSWithEmptyNameHeader() throws Exception {
resultEndpoint.expectedMessageCount(0);
try {
- template.sendBodyAndHeader("hello", "dns.name", "");
+ template.sendBodyAndHeader("hello", DnsConstants.DNS_NAME, "");
fail("Should have thrown exception");
} catch (Exception t) {
assertTrue(t.getCause() instanceof IllegalArgumentException, t.toString());
@@ -90,7 +90,7 @@ public boolean matches(Exchange exchange) {
}
});
Map headers = new HashMap<>();
- headers.put("dns.name", "www.example.com");
+ headers.put(DnsConstants.DNS_NAME, "www.example.com");
template.sendBodyAndHeaders("hello", headers);
resultEndpoint.assertIsSatisfied();
}
@@ -106,8 +106,8 @@ public boolean matches(Exchange exchange) {
}
});
Map headers = new HashMap<>();
- headers.put("dns.name", "www.example.com");
- headers.put("dns.type", "A");
+ headers.put(DnsConstants.DNS_NAME, "www.example.com");
+ headers.put(DnsConstants.DNS_TYPE, "A");
template.sendBodyAndHeaders("hello", headers);
resultEndpoint.assertIsSatisfied();
}
diff --git a/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointSpringTest.java b/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointSpringTest.java
index 51342d45a0f6b..58a431a708464 100644
--- a/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointSpringTest.java
+++ b/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointSpringTest.java
@@ -59,7 +59,7 @@ public boolean matches(Exchange exchange) {
}
});
Map headers = new HashMap<>();
- headers.put("term", "monkey");
+ headers.put(DnsConstants.TERM, "monkey");
template.sendBodyAndHeaders(null, headers);
resultEndpoint.assertIsSatisfied();
}
diff --git a/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointTest.java b/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointTest.java
index 717b685c89532..ecba05e3294aa 100644
--- a/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointTest.java
+++ b/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointTest.java
@@ -68,7 +68,7 @@ public boolean matches(Exchange exchange) {
}
});
Map headers = new HashMap<>();
- headers.put("term", "monkey");
+ headers.put(DnsConstants.TERM, "monkey");
template.sendBodyAndHeaders(null, headers);
resultEndpoint.assertIsSatisfied();
}
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DnsEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DnsEndpointBuilderFactory.java
index 5d0d76347e554..23b563a7d7279 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DnsEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DnsEndpointBuilderFactory.java
@@ -182,10 +182,10 @@ public static class DnsHeaderNameBuilder {
*
* Group: lookup dig
*
- * @return the name of the header {@code dns.class}.
+ * @return the name of the header {@code DnsClass}.
*/
public String dnsClass() {
- return "dns.class";
+ return "CamelDnsClass";
}
/**
* The name to lookup.
@@ -195,10 +195,10 @@ public String dnsClass() {
* Required: true
* Group: lookup
*
- * @return the name of the header {@code dns.name}.
+ * @return the name of the header {@code DnsName}.
*/
public String dnsName() {
- return "dns.name";
+ return "CamelDnsName";
}
/**
* The domain name.
@@ -208,10 +208,10 @@ public String dnsName() {
* Required: true
* Group: ip
*
- * @return the name of the header {@code dns.domain}.
+ * @return the name of the header {@code DnsDomain}.
*/
public String dnsDomain() {
- return "dns.domain";
+ return "CamelDnsDomain";
}
/**
* The server in particular for the query. If none is given, the default
@@ -221,10 +221,10 @@ public String dnsDomain() {
*
* Group: dig
*
- * @return the name of the header {@code dns.server}.
+ * @return the name of the header {@code DnsServer}.
*/
public String dnsServer() {
- return "dns.server";
+ return "CamelDnsServer";
}
/**
* The type of the lookup. Should match the values of
@@ -234,10 +234,10 @@ public String dnsServer() {
*
* Group: lookup dig
*
- * @return the name of the header {@code dns.type}.
+ * @return the name of the header {@code DnsType}.
*/
public String dnsType() {
- return "dns.type";
+ return "CamelDnsType";
}
/**
* The term.
@@ -247,10 +247,10 @@ public String dnsType() {
* Required: true
* Group: wikipedia
*
- * @return the name of the header {@code term}.
+ * @return the name of the header {@code DnsTerm}.
*/
- public String term() {
- return "term";
+ public String dnsTerm() {
+ return "CamelDnsTerm";
}
}
static DnsEndpointBuilder endpointBuilder(String componentName, String path) {