mirror of
https://gitee.com/dromara/hutool.git
synced 2025-06-28 13:34:09 +08:00
add test
This commit is contained in:
parent
bc5ec5c5d2
commit
9e853db9ee
@ -0,0 +1,24 @@
|
|||||||
|
package cn.hutool.json;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class IssueI8PC9FTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void toBeanIgnoreErrorTest() {
|
||||||
|
final String testJson = "{\"testMap\":\"\"}";
|
||||||
|
final TestBean test = JSONUtil.parseObj(testJson, JSONConfig.create().setIgnoreError(true))
|
||||||
|
.toBean(TestBean.class);
|
||||||
|
Assert.assertNotNull(test);
|
||||||
|
Assert.assertNull(test.getTestMap());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
static class TestBean{
|
||||||
|
private Map<?, ?> testMap;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user