@@ -117,7 +117,7 @@ void canDecodeWithObjectMapperRegistrationForType() {
117117 }
118118
119119 @ Test // SPR-15866
120- public void canDecodeWithProvidedMimeType () {
120+ void canDecodeWithProvidedMimeType () {
121121 MimeType textJavascript = new MimeType ("text" , "javascript" , StandardCharsets .UTF_8 );
122122 Jackson2JsonDecoder decoder = new Jackson2JsonDecoder (new ObjectMapper (), textJavascript );
123123
@@ -239,15 +239,15 @@ void invalidData() {
239239 }
240240
241241 @ Test // gh-22042
242- public void decodeWithNullLiteral () {
242+ void decodeWithNullLiteral () {
243243 Flux <Object > result = this .decoder .decode (Flux .concat (stringBuffer ("null" )),
244244 ResolvableType .forType (Pojo .class ), MediaType .APPLICATION_JSON , Collections .emptyMap ());
245245
246246 StepVerifier .create (result ).expectComplete ().verify ();
247247 }
248248
249249 @ Test // gh-27511
250- public void noDefaultConstructor () {
250+ void noDefaultConstructor () {
251251 Flux <DataBuffer > input = Flux .from (stringBuffer ("{\" property1\" :\" foo\" ,\" property2\" :\" bar\" }" ));
252252
253253 testDecode (input , BeanWithNoDefaultConstructor .class , step -> step
@@ -268,7 +268,7 @@ void codecException() {
268268 }
269269
270270 @ Test // SPR-15975
271- public void customDeserializer () {
271+ void customDeserializer () {
272272 Mono <DataBuffer > input = stringBuffer ("{\" test\" : 1}" );
273273
274274 testDecode (input , TestObject .class , step -> step
@@ -289,7 +289,7 @@ void bigDecimalFlux() {
289289
290290 @ Test
291291 @ SuppressWarnings ("unchecked" )
292- public void decodeNonUtf8Encoding () {
292+ void decodeNonUtf8Encoding () {
293293 Mono <DataBuffer > input = stringBuffer ("{\" foo\" :\" bar\" }" , StandardCharsets .UTF_16 );
294294 ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
295295
@@ -302,7 +302,7 @@ public void decodeNonUtf8Encoding() {
302302
303303 @ Test
304304 @ SuppressWarnings ("unchecked" )
305- public void decodeNonUnicode () {
305+ void decodeNonUnicode () {
306306 Flux <DataBuffer > input = Flux .concat (stringBuffer ("{\" føø\" :\" bår\" }" , StandardCharsets .ISO_8859_1 ));
307307 ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
308308
@@ -315,7 +315,7 @@ public void decodeNonUnicode() {
315315
316316 @ Test
317317 @ SuppressWarnings ("unchecked" )
318- public void decodeMonoNonUtf8Encoding () {
318+ void decodeMonoNonUtf8Encoding () {
319319 Mono <DataBuffer > input = stringBuffer ("{\" foo\" :\" bar\" }" , StandardCharsets .UTF_16 );
320320 ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
321321
@@ -328,7 +328,7 @@ public void decodeMonoNonUtf8Encoding() {
328328
329329 @ Test
330330 @ SuppressWarnings ("unchecked" )
331- public void decodeAscii () {
331+ void decodeAscii () {
332332 Flux <DataBuffer > input = Flux .concat (stringBuffer ("{\" foo\" :\" bar\" }" , StandardCharsets .US_ASCII ));
333333 ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
334334
@@ -339,6 +339,15 @@ public void decodeAscii() {
339339 null );
340340 }
341341
342+ @ Test
343+ void cancelWhileDecoding () {
344+ Flux <DataBuffer > input = Flux .just (
345+ stringBuffer ("[{\" bar\" :\" b1\" ,\" foo\" :\" f1\" }," ).block (),
346+ stringBuffer ("{\" bar\" :\" b2\" ,\" foo\" :\" f2\" }]" ).block ());
347+
348+ testDecodeCancel (input , ResolvableType .forClass (Pojo .class ), null , null );
349+ }
350+
342351
343352 private Mono <DataBuffer > stringBuffer (String value ) {
344353 return stringBuffer (value , StandardCharsets .UTF_8 );
0 commit comments