Skip to content

Commit e173a1a

Browse files
committed
Fix test case for Codacy.
Signed-off-by: jjhz <[email protected]>
1 parent b52cfd1 commit e173a1a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/test/java/org/cyclonedx/BomXmlGeneratorTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,10 @@ public void testComponentAuthorsSerializationAndDeserialization(String xmlFilePa
837837
// Verify the xml content
838838
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
839839
dbf.setNamespaceAware(true);
840+
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
841+
dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
842+
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
843+
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
840844
Document doc = dbf.newDocumentBuilder()
841845
.parse(new java.io.ByteArrayInputStream(xmlString.getBytes()));
842846

0 commit comments

Comments
 (0)