mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-24 18:04:54 +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());
|
||||
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…
Reference in New Issue
Block a user