You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/06/02 08:04:10 UTC
[camel-k] 04/08: XML DSL support for wireTap
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit d6f4959e0f78aa2f457a359e88ba3e2ef5e0d52f
Author: Adriano Machado <unknown>
AuthorDate: Mon May 30 12:10:22 2022 -0400
XML DSL support for wireTap
---
pkg/util/source/inspector_xml.go | 2 +-
pkg/util/source/inspector_xml_test.go | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/pkg/util/source/inspector_xml.go b/pkg/util/source/inspector_xml.go
index 18c48277c..51baaee24 100644
--- a/pkg/util/source/inspector_xml.go
+++ b/pkg/util/source/inspector_xml.go
@@ -62,7 +62,7 @@ func (i XMLInspector) Extract(source v1.SourceSpec, meta *Metadata) error {
meta.FromURIs = append(meta.FromURIs, a.Value)
}
}
- case "to", "toD", "toF":
+ case "to", "toD", "toF", "wireTap":
for _, a := range se.Attr {
if a.Name.Local == "uri" {
meta.ToURIs = append(meta.ToURIs, a.Value)
diff --git a/pkg/util/source/inspector_xml_test.go b/pkg/util/source/inspector_xml_test.go
index 52445e820..8552a84b7 100644
--- a/pkg/util/source/inspector_xml_test.go
+++ b/pkg/util/source/inspector_xml_test.go
@@ -46,6 +46,15 @@ const XMLKameletEndpoint = `
</camelContext>
`
+const XMLWireTapEndpoint = `
+<camelContext xmlns="http://camel.apache.org/schema/spring">
+ <route>
+ <from uri="direct:start"/>
+ <wireTap uri="kamelet:foo/bar?baz=test"/>
+ </route>
+</camelContext>
+`
+
func TestXMLKamelet(t *testing.T) {
tc := []struct {
source string
@@ -59,6 +68,10 @@ func TestXMLKamelet(t *testing.T) {
source: XMLKameletEndpoint,
kamelets: []string{"foo/bar"},
},
+ {
+ source: XMLWireTapEndpoint,
+ kamelets: []string{"foo/bar"},
+ },
}
for i := range tc {