File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
modules/elasticsearch/src/test/java/org/elasticsearch/common/xcontent/builder Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 19
19
20
20
package org .elasticsearch .common .xcontent .builder ;
21
21
22
+ import org .elasticsearch .common .collect .Lists ;
22
23
import org .elasticsearch .common .io .FastByteArrayOutputStream ;
23
24
import org .elasticsearch .common .io .FastCharArrayWriter ;
24
25
import org .elasticsearch .common .xcontent .XContentBuilder ;
@@ -67,6 +68,12 @@ public class XContentBuilderTests {
67
68
assertThat (builder .string (), equalTo ("{\" test\" :\" value\" }" ));
68
69
}
69
70
71
+ @ Test public void testOverloadedList () throws Exception {
72
+ XContentBuilder builder = XContentFactory .contentBuilder (XContentType .JSON );
73
+ builder .startObject ().field ("test" , Lists .newArrayList ("1" , "2" )).endObject ();
74
+ assertThat (builder .string (), equalTo ("{\" test\" :[\" 1\" ,\" 2\" ]}" ));
75
+ }
76
+
70
77
@ Test public void testWritingBinaryToStream () throws Exception {
71
78
FastByteArrayOutputStream bos = new FastByteArrayOutputStream ();
72
79
You can’t perform that action at this time.
0 commit comments