mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test for mapProxy
This commit is contained in:
parent
2e628b08c5
commit
844c4be0bf
@ -28,4 +28,20 @@ public class MapProxyTest {
|
|||||||
Set<Entry<Object,Object>> entrys = mapProxy.entrySet();
|
Set<Entry<Object,Object>> entrys = mapProxy.entrySet();
|
||||||
Assert.assertFalse(entrys.isEmpty());
|
Assert.assertFalse(entrys.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private interface Student {
|
||||||
|
Student setName(String name);
|
||||||
|
Student setAge(int age);
|
||||||
|
|
||||||
|
String getName();
|
||||||
|
int getAge();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void classProxyTest() {
|
||||||
|
Student student = MapProxy.create(new HashMap<>()).toProxyBean(Student.class);
|
||||||
|
student.setName("小明").setAge(18);
|
||||||
|
Assert.assertEquals(student.getAge(), 18);
|
||||||
|
Assert.assertEquals(student.getName(), "小明");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user