From e52aa5183a2216c2673b5517d1686a0506cf20bf Mon Sep 17 00:00:00 2001 From: Looly Date: Thu, 24 Oct 2024 18:58:43 +0800 Subject: [PATCH] add test --- .../hutool/core/bean/IssueIAYGT0Test.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 hutool-core/src/test/java/org/dromara/hutool/core/bean/IssueIAYGT0Test.java diff --git a/hutool-core/src/test/java/org/dromara/hutool/core/bean/IssueIAYGT0Test.java b/hutool-core/src/test/java/org/dromara/hutool/core/bean/IssueIAYGT0Test.java new file mode 100644 index 000000000..e9f0d9bcd --- /dev/null +++ b/hutool-core/src/test/java/org/dromara/hutool/core/bean/IssueIAYGT0Test.java @@ -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; + } + } +}