mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
a4bcf2a45c
commit
5eee1e5423
@ -278,4 +278,11 @@ public class MapUtilTest {
|
|||||||
final Map<Object, Object> map = MapUtil.createMap(MapUtil.view(new HashMap<>()).getClass());
|
final Map<Object, Object> map = MapUtil.createMap(MapUtil.view(new HashMap<>()).getClass());
|
||||||
Assertions.assertEquals(HashMap.class, map.getClass());
|
Assertions.assertEquals(HashMap.class, map.getClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void renameKeyTest() {
|
||||||
|
final Dict v1 = Dict.of().set("id", 12).set("name", "张三").set("age", null);
|
||||||
|
final Map<String, Object> map = MapUtil.renameKey(v1, "name", "newName");
|
||||||
|
Assertions.assertEquals("张三", map.get("newName"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user