mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
修复NumberWithFormat没有实现Comparable接口导致的JSON排序报错问题(issue#ID61QR@Gitee)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class IssueID61QRTest {
|
||||
@Test
|
||||
public void testName() {
|
||||
JSONObject map1 = JSONUtil.createObj(new JSONConfig().setDateFormat("yyyy"));
|
||||
// JSONObject map1 = JSONUtil.createObj();
|
||||
map1.set("a", 3);
|
||||
map1.set("b", 5);
|
||||
map1.set("c", 5432);
|
||||
Assertions.assertEquals("{c=5432, b=5, a=3}", MapUtil.sortByValue(JSONUtil.toBean(map1, Map.class), true).toString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user