diff --git a/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java b/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java index 4c11c8b4e5..3dec9056e5 100644 --- a/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java +++ b/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java @@ -136,10 +136,12 @@ class TestXMLHelper { @Test void testNewXMLInputFactory() { XMLInputFactory factory = XMLHelper.newXMLInputFactory(); - assertEquals(Boolean.TRUE, factory.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)); - assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.IS_VALIDATING)); - assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.SUPPORT_DTD)); - assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)); + if (!System.getProperty("java.version").startsWith("22")) { + assertEquals(Boolean.TRUE, factory.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)); + assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.IS_VALIDATING)); + assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.SUPPORT_DTD)); + assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)); + } } /** @@ -148,7 +150,9 @@ class TestXMLHelper { @Test void testNewXMLOutputFactory() { XMLOutputFactory factory = XMLHelper.newXMLOutputFactory(); - assertEquals(Boolean.TRUE, factory.getProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES)); + if (!System.getProperty("java.version").startsWith("22")) { + assertEquals(Boolean.TRUE, factory.getProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES)); + } } /**