Skip to content

Commit

Permalink
add testcase for issue #1893
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Oct 28, 2023
1 parent d4c5410 commit 94c4700
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.alibaba.fastjson2.v1issues.issue_1800;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONWriter;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class Issue1893 {
@Test
public void test() throws Exception {
assertEquals(
"{\"value\":\"0\"}",
JSON.toJSONString(new Bean(),
JSONWriter.Feature.WriteNullNumberAsZero,
JSONWriter.Feature.WriteLongAsString)
);
}

public static class Bean {
public Long value;
}
}

0 comments on commit 94c4700

Please sign in to comment.