修复isXXX转换时的匹配问题

This commit is contained in:
Looly
2023-02-22 19:33:56 +08:00
parent fb3ea9a3cf
commit fe7751342e
4 changed files with 26 additions and 15 deletions

View File

@@ -0,0 +1,19 @@
package cn.hutool.json;
import lombok.Data;
import org.junit.Assert;
import org.junit.Test;
public class IssueI6H0XFTest {
@Test
public void toBeanTest(){
final Demo demo = JSONUtil.toBean("{\"biz\":\"A\",\"isBiz\":true}", Demo.class);
Assert.assertEquals("A", demo.getBiz());
Assert.assertEquals("{\"biz\":\"A\"}", JSONUtil.toJsonStr(demo));
}
@Data
static class Demo {
String biz;
}
}