当用户选择ignoreError时,错误对象转JSON也忽略

This commit is contained in:
Looly
2023-03-26 06:02:22 +08:00
parent 1ac0a904c0
commit 317d8ee527
3 changed files with 7 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ public class JSONUtilTest {
*/
@Test
public void parseNumberTest2() {
final JSONObject json = JSONUtil.parseObj(123L);
final JSONObject json = JSONUtil.parseObj(123L, JSONConfig.create().setIgnoreError(true));
Assert.assertEquals(new JSONObject(), json);
}