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
58637f2514
commit
e52aa5183a
@ -0,0 +1,26 @@
|
||||
package org.dromara.hutool.core.bean;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class IssueIAYGT0Test {
|
||||
@Test
|
||||
void setPropertyTest() {
|
||||
final Cat cat = new Cat();
|
||||
// 优先调用setter方法
|
||||
BeanUtil.setProperty(cat, "name", "Kitty");
|
||||
Assertions.assertEquals("RedKitty", cat.getName());
|
||||
}
|
||||
|
||||
static class Cat {
|
||||
private String name;
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = "Red" + name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user