mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
Converter转换规则变更,空对象、空值转为Bean时,创建默认对象,而非nul
This commit is contained in:
17
hutool-json/src/test/java/cn/hutool/json/Issue3649Test.java
Normal file
17
hutool-json/src/test/java/cn/hutool/json/Issue3649Test.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import lombok.Data;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class Issue3649Test {
|
||||
@Test
|
||||
public void toEmptyBeanTest() {
|
||||
final Object bean = JSONUtil.toBean("{}", JSONConfig.create().setIgnoreError(true), EmptyBean.class);
|
||||
assertEquals(new EmptyBean(), bean);
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class EmptyBean {}
|
||||
}
|
Reference in New Issue
Block a user