mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add test
This commit is contained in:
parent
61b6c63470
commit
d791395455
@ -1,6 +1,7 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
@ -224,4 +225,13 @@ public class JSONUtilTest {
|
||||
String str = "{\"test\":100000054128897953e4}";
|
||||
Assert.assertEquals("{\"test\":1000000541288979530000}", JSONUtil.parseObj(str).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toXmlTest(){
|
||||
final JSONObject obj = JSONUtil.createObj();
|
||||
obj.set("key1", "v1")
|
||||
.set("key2", ListUtil.of("a", "b", "c"));
|
||||
final String xmlStr = JSONUtil.toXmlStr(obj);
|
||||
Assert.assertEquals("<key1>v1</key1><key2>a</key2><key2>b</key2><key2>c</key2>", xmlStr);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user