Skip to content

Commit 5c448dd

Browse files
committed
Fixing test after XMLUnit upgrade
1 parent 7abb60b commit 5c448dd

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/test/java/org/apache/xml/security/test/stax/XMLSecurityStreamWriterTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.util.Set;
2929

3030
import javax.xml.namespace.NamespaceContext;
31+
import javax.xml.parsers.DocumentBuilderFactory;
3132
import javax.xml.stream.XMLEventWriter;
3233
import javax.xml.stream.XMLOutputFactory;
3334
import javax.xml.stream.XMLStreamException;
@@ -46,6 +47,7 @@
4647
import org.junit.jupiter.api.BeforeEach;
4748
import org.junit.jupiter.api.Test;
4849
import org.xmlunit.matchers.CompareMatcher;
50+
import org.xmlunit.util.DocumentBuilderFactoryConfigurer;
4951

5052
import static org.hamcrest.MatcherAssert.assertThat;
5153
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -189,7 +191,11 @@ public Iterator<String> getPrefixes(String namespaceURI) {
189191
stdXmlStreamWriter.close();
190192
}
191193

192-
assertThat(stdStringWriter.toString(), CompareMatcher.isSimilarTo(securityStringWriter.toString()));
194+
assertThat(stdStringWriter.toString(),
195+
CompareMatcher.isSimilarTo(securityStringWriter.toString())
196+
.withDocumentBuilderFactory(
197+
DocumentBuilderFactoryConfigurer.DefaultWithDTDParsing.configure(
198+
DocumentBuilderFactory.newInstance())));
193199
}
194200

195201
// @see https://issues.apache.org/jira/browse/SANTUARIO-433

0 commit comments

Comments
 (0)