mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-04 12:47:59 +08:00
add test
This commit is contained in:
parent
1637e5d4ae
commit
eb535e66ef
@ -0,0 +1,24 @@
|
|||||||
|
package org.dromara.hutool.json;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class IssueI8PC9FTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void toBeanIgnoreErrorTest() {
|
||||||
|
final String testJson = "{\"testMap\":\"\"}";
|
||||||
|
final TestBean test = JSONUtil.parseObj(testJson, JSONConfig.of().setIgnoreError(true))
|
||||||
|
.toBean(TestBean.class);
|
||||||
|
Assertions.assertNotNull(test);
|
||||||
|
Assertions.assertNull(test.getTestMap());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
static class TestBean{
|
||||||
|
private Map<?, ?> testMap;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user