This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improved for guava multimap support, for issue #2132
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
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
16 changes: 16 additions & 0 deletions
16
src/test/java/com/alibaba/json/bvt/issue_2100/Issue2129.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,16 @@ | ||
package com.alibaba.json.bvt.issue_2100; | ||
|
||
import com.alibaba.fastjson.JSON; | ||
import com.google.common.collect.LinkedHashMultimap; | ||
import junit.framework.TestCase; | ||
|
||
public class Issue2129 extends TestCase { | ||
public void test_for_issue() throws Exception { | ||
LinkedHashMultimap<String, String> map = LinkedHashMultimap.create(); | ||
map.put("a", "1"); | ||
map.put("a", "b"); | ||
map.put("b", "1"); | ||
String json = JSON.toJSONString(map); | ||
assertEquals("{\"a\":[\"1\",\"b\"],\"b\":[\"1\"]}", json); | ||
} | ||
} |