forked from alibaba/fastjson2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix remove the field writer which only differ in first character that…
… one is upper case the other is lower case (alibaba#3222) * fix remove the field writer which only differ in first character that one is upper case the other is lower case, for issue 3220 * fix build error * add test
- Loading branch information
1 parent
3ce6eea
commit 9d3e91c
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
core/src/test/java/com/alibaba/fastjson2/issues_3200/Issue3220.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.alibaba.fastjson2.issues_3200; | ||
|
||
import com.alibaba.fastjson2.JSON; | ||
import lombok.Data; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class Issue3220 { | ||
@Test | ||
public void test() { | ||
Param param = new Param(); | ||
param.setUserName("张三"); | ||
param.setCode("001"); | ||
param.setSort("1"); | ||
param.setStatus("正常"); | ||
assertEquals("{\"code\":\"001\",\"sort\":\"1\",\"status\":\"正常\",\"userName\":\"张三\"}", JSON.toJSONString(param)); | ||
} | ||
|
||
@Data | ||
private static class Param { | ||
public String UserName; | ||
String Code; | ||
String Sort; | ||
String Status; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters