From 0f745075e1dc954de83377cda98c4f8af6bb8fbd Mon Sep 17 00:00:00 2001 From: wenshao Date: Thu, 21 Nov 2024 09:36:04 +0800 Subject: [PATCH] add testcase for issue #3163 --- .../fastjson2/issues_3100/Issue3163.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 core/src/test/java/com/alibaba/fastjson2/issues_3100/Issue3163.java diff --git a/core/src/test/java/com/alibaba/fastjson2/issues_3100/Issue3163.java b/core/src/test/java/com/alibaba/fastjson2/issues_3100/Issue3163.java new file mode 100644 index 000000000..31c461616 --- /dev/null +++ b/core/src/test/java/com/alibaba/fastjson2/issues_3100/Issue3163.java @@ -0,0 +1,20 @@ +package com.alibaba.fastjson2.issues_3100; + +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.annotation.JSONField; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class Issue3163 { + @Test + public void test() { + Bean bean = JSON.parseObject("{\"id\":1234}", Bean.class); + assertEquals(0, bean.id); + } + + public static class Bean { + @JSONField(deserialize = false) + public int id; + } +}