This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch yaml-ns
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 65ffdfbfcd343374dd2a81912c952d0974ca483c
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Nov 11 10:49:03 2024 +0100

    CAMEL-21420: camel-xml-io: Parser should handle default Camel namespace 
better.
---
 .../src/test/java/org/apache/camel/xml/out/ModelWriterTest.java  | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/core/camel-xml-io/src/test/java/org/apache/camel/xml/out/ModelWriterTest.java 
b/core/camel-xml-io/src/test/java/org/apache/camel/xml/out/ModelWriterTest.java
index 77783aa9b78..d9e38f81507 100644
--- 
a/core/camel-xml-io/src/test/java/org/apache/camel/xml/out/ModelWriterTest.java
+++ 
b/core/camel-xml-io/src/test/java/org/apache/camel/xml/out/ModelWriterTest.java
@@ -51,9 +51,11 @@ import org.junit.jupiter.api.DisplayName;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.Arguments;
 import org.junit.jupiter.params.provider.MethodSource;
+import org.w3c.dom.Node;
 import org.xmlunit.assertj3.XmlAssert;
 import org.xmlunit.diff.DefaultNodeMatcher;
 import org.xmlunit.diff.ElementSelectors;
+import org.xmlunit.util.Predicate;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.AssertionFailureBuilder.assertionFailure;
@@ -104,6 +106,13 @@ public class ModelWriterTest {
         XmlAssert.assertThat(generatedXml)
                 .and(original)
                 .withNodeMatcher(new 
DefaultNodeMatcher(ElementSelectors.byNameAndText))
+                .withNodeFilter(node -> {
+                    // skip comparing namespace as original have namespaces 
scattered in other places than inside <xpath>
+                    if ("namespace".equals(node.getLocalName())) {
+                        return false;
+                    }
+                    return true;
+                })
                 .ignoreWhitespace()
                 .ignoreElementContentWhitespace()
                 .ignoreComments()

Reply via email to