diff --git a/smack-core/src/test/java/org/jivesoftware/smack/packet/IqTest.java b/smack-core/src/test/java/org/jivesoftware/smack/packet/IqTest.java
index b8f192bd7..041c66981 100644
--- a/smack-core/src/test/java/org/jivesoftware/smack/packet/IqTest.java
+++ b/smack-core/src/test/java/org/jivesoftware/smack/packet/IqTest.java
@@ -1,6 +1,6 @@
/**
*
- * Copyright © 2023 Florian Schmaus
+ * Copyright © 2023-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,13 @@ package org.jivesoftware.smack.packet;
import static org.jivesoftware.smack.test.util.XmlAssertUtil.assertXmlSimilar;
+import org.jivesoftware.smack.test.util.SmackTestUtil;
+import org.jivesoftware.smack.util.PacketParserUtils;
+import org.jivesoftware.smack.xml.XmlPullParser;
+
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.EnumSource;
public class IqTest {
@@ -35,4 +41,21 @@ public class IqTest {
assertXmlSimilar(expected, errorIq.toXML());
}
+ @ParameterizedTest
+ @EnumSource(SmackTestUtil.XmlPullParserKind.class)
+ public void testIqWithXmlns(SmackTestUtil.XmlPullParserKind parserKind) throws Exception {
+ final String iqXml = "" +
+ "" +
+ "foo@tigase.mydomain.org/myresource" +
+ "" +
+ "";
+ final String xml =
+ "" +
+ iqXml +
+ "";
+
+ XmlPullParser parser = SmackTestUtil.getParserFor(xml, "iq", parserKind);
+ IQ iq = PacketParserUtils.parseIQ(parser);
+ assertXmlSimilar(iqXml, iq.toXML());
+ }
}