This commit is contained in:
Looly
2020-03-22 16:45:25 +08:00
parent 7c05a71159
commit 0cd79bcbfd
6 changed files with 84 additions and 36 deletions

View File

@@ -0,0 +1,15 @@
package cn.hutool.json;
import org.junit.Assert;
import org.junit.Test;
public class XMLTest {
@SuppressWarnings("ConstantConditions")
@Test
public void toXmlTest(){
final JSONObject put = JSONUtil.createObj().put("aaa", "你好").put("键2", "test");
final String s = JSONUtil.toXmlStr(put);
Assert.assertEquals("<aaa>你好</aaa><键2>test</键2>", s);
}
}