This commit is contained in:
Looly
2022-08-26 10:14:39 +08:00
parent 7d3c567961
commit 897bd5d801
2 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package cn.hutool.json;
import lombok.Getter;
import lombok.Setter;
import org.junit.Assert;
import org.junit.Test;
public class Issue2564Test {
/**
* 实力类 没有get set方法不能被认为是一个bean
*/
@Test()
public void emptyToBeanTest(){
final String x = "{}";
final A a = JSONUtil.toBean(x, JSONConfig.of().setIgnoreError(true), A.class);
Assert.assertNull(a);
}
@Getter
@Setter
public static class A{
}
}