-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
core/src/test/java/com/alibaba/fastjson2/issues_1600/Issue1646.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,29 @@ | ||
package com.alibaba.fastjson2.issues_1600; | ||
|
||
import com.alibaba.fastjson2.JSONObject; | ||
import com.alibaba.fastjson2.JSONReader; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Map; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class Issue1646 { | ||
@Test | ||
public void test() { | ||
String s = "{\"test\":{null:\"a\",\"b\":\"c\"}}"; | ||
Bean bean = (Bean) JSONObject.parseObject(s, Bean.class, JSONReader.Feature.AllowUnQuotedFieldNames); | ||
assertEquals("a", bean.getTest().get("null")); | ||
} | ||
|
||
public class Bean { | ||
private Map<String, String> test; | ||
public Map<String, String> getTest() { | ||
return test; | ||
} | ||
|
||
public void setTest(Map<String, String> test) { | ||
this.test = test; | ||
} | ||
} | ||
} |