修复XmlUtil.xmlToBean空节点转换失败问题

This commit is contained in:
Looly
2023-06-16 19:25:23 +08:00
parent 7351aec47d
commit 143cd59b08
@@ -19,8 +19,14 @@ import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
/**
* https://github.com/dromara/hutool/issues/3136
*/
public class Issue3136Test {
/**
* 此用例中,message节点无content,理解为空节点,转换为map后,此节点值为"",转为对象时,理应为null
*/
@Test
public void xmlToBeanTest() {
final String xmlStr = "<?xml version=\"1.0\" encoding=\"gbk\" ?><response><code>02</code><message></message></response>";