This commit is contained in:
Looly
2022-11-10 12:09:37 +08:00
parent 1eb8acfcba
commit 10ffd8750b
2 changed files with 12 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package cn.hutool.core.bean;
import cn.hutool.core.lang.test.bean.ExamInfoDict;
import cn.hutool.core.lang.test.bean.UserInfoDict;
import cn.hutool.core.map.Dict;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -144,4 +145,11 @@ public class BeanPathTest {
beanPath.set(map, "张三");
Assert.assertEquals("{list=[[null, {name=张三}]]}", map.toString());
}
@Test
public void putByPathTest() {
final Dict dict = new Dict();
BeanPath.of("aa.bb").set(dict, "BB");
Assert.assertEquals("{aa={bb=BB}}", dict.toString());
}
}