@@ -60,6 +60,7 @@ public void decodeMultipleChunksToJsonObject() throws InterruptedException {
60
60
@ Test
61
61
public void decodeSingleChunkToArray () throws InterruptedException {
62
62
JsonObjectDecoder decoder = new JsonObjectDecoder ();
63
+
63
64
Flux <DataBuffer > source = Flux .just (stringBuffer (
64
65
"[{\" foo\" : \" foofoo\" , \" bar\" : \" barbar\" },{\" foo\" : \" foofoofoo\" , \" bar\" : \" barbarbar\" }]" ));
65
66
Flux <String > output =
@@ -69,11 +70,20 @@ public void decodeSingleChunkToArray() throws InterruptedException {
69
70
.expectNext ("{\" foo\" : \" foofoofoo\" , \" bar\" : \" barbarbar\" }" )
70
71
.expectComplete ()
71
72
.verify (output );
73
+
74
+ source = Flux .just (stringBuffer ("[{\" foo\" : \" bar\" },{\" foo\" : \" baz\" }]" ));
75
+ output = decoder .decode (source , null , null , Collections .emptyMap ()).map (JsonObjectDecoderTests ::toString );
76
+ ScriptedSubscriber .<String >create ()
77
+ .expectNext ("{\" foo\" : \" bar\" }" )
78
+ .expectNext ("{\" foo\" : \" baz\" }" )
79
+ .expectComplete ()
80
+ .verify (output );
72
81
}
73
82
74
83
@ Test
75
84
public void decodeMultipleChunksToArray () throws InterruptedException {
76
85
JsonObjectDecoder decoder = new JsonObjectDecoder ();
86
+
77
87
Flux <DataBuffer > source =
78
88
Flux .just (stringBuffer ("[{\" foo\" : \" foofoo\" , \" bar\" " ), stringBuffer (
79
89
": \" barbar\" },{\" foo\" : \" foofoofoo\" , \" bar\" : \" barbarbar\" }]" ));
@@ -84,6 +94,18 @@ public void decodeMultipleChunksToArray() throws InterruptedException {
84
94
.expectNext ("{\" foo\" : \" foofoofoo\" , \" bar\" : \" barbarbar\" }" )
85
95
.expectComplete ()
86
96
.verify (output );
97
+
98
+ source = Flux .just (
99
+ stringBuffer ("[{\" foo\" : \" " ),
100
+ stringBuffer ("bar\" },{\" fo" ),
101
+ stringBuffer ("o\" : \" baz\" }" ),
102
+ stringBuffer ("]" ));
103
+ output = decoder .decode (source , null , null , Collections .emptyMap ()).map (JsonObjectDecoderTests ::toString );
104
+ ScriptedSubscriber .<String >create ()
105
+ .expectNext ("{\" foo\" : \" bar\" }" )
106
+ .expectNext ("{\" foo\" : \" baz\" }" )
107
+ .expectComplete ()
108
+ .verify (output );
87
109
}
88
110
89
111
0 commit comments