Skip to content

Commit e9e43ab

Browse files
committed
Added test case for duplicate names in JSON objects
1 parent 969a803 commit e9e43ab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test/java/org/culturegraph/mf/stream/converter/JsonEncoderTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ public void testShouldEncodeNestedLists() {
154154

155155
verify(receiver).process(fixQuotes("{'Li1':[['V1','V2'],['V3','V4']]}"));
156156
}
157+
158+
@Test
159+
public void testShouldOutputDuplicateNames() {
160+
encoder.startRecord("");
161+
encoder.literal(LITERAL1, VALUE1);
162+
encoder.literal(LITERAL1, VALUE2);
163+
encoder.endRecord();
164+
165+
verify(receiver).process(fixQuotes("{'L1':'V1','L1':'V2'}"));
166+
}
157167

158168
/*
159169
* Utility method which replaces all single quotes in a string with double quotes.

0 commit comments

Comments
 (0)