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

This commit is contained in:
Looly 2023-06-16 19:25:23 +08:00
parent 7351aec47d
commit 143cd59b08

View File

@ -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>";