This commit is contained in:
Looly
2023-06-16 23:27:49 +08:00
parent f901c9419d
commit 0760e44c12
14 changed files with 1308 additions and 806 deletions

View File

@@ -1,6 +1,7 @@
package org.dromara.hutool.json;
import org.dromara.hutool.core.io.resource.ResourceUtil;
import org.dromara.hutool.core.xml.XPathUtil;
import org.dromara.hutool.core.xml.XmlUtil;
import org.dromara.hutool.json.xml.JSONXMLSerializer;
import org.junit.jupiter.api.Assertions;
@@ -13,7 +14,7 @@ public class IssueI676ITTest {
public void parseXMLTest() {
final JSONObject jsonObject = JSONUtil.parseObj(ResourceUtil.readUtf8Str("issueI676IT.json"));
final String xmlStr = JSONXMLSerializer.toXml(jsonObject, null, (String) null);
final String content = String.valueOf(XmlUtil.getByXPath("/page/orderItems[1]/content", XmlUtil.readXML(xmlStr), XPathConstants.STRING));
final String content = String.valueOf(XPathUtil.getByXPath("/page/orderItems[1]/content", XmlUtil.readXml(xmlStr), XPathConstants.STRING));
Assertions.assertEquals(content, "bar1");
}
}