@@ -117,7 +117,7 @@ void canDecodeWithObjectMapperRegistrationForType() {
117
117
}
118
118
119
119
@ Test // SPR-15866
120
- public void canDecodeWithProvidedMimeType () {
120
+ void canDecodeWithProvidedMimeType () {
121
121
MimeType textJavascript = new MimeType ("text" , "javascript" , StandardCharsets .UTF_8 );
122
122
Jackson2JsonDecoder decoder = new Jackson2JsonDecoder (new ObjectMapper (), textJavascript );
123
123
@@ -239,15 +239,15 @@ void invalidData() {
239
239
}
240
240
241
241
@ Test // gh-22042
242
- public void decodeWithNullLiteral () {
242
+ void decodeWithNullLiteral () {
243
243
Flux <Object > result = this .decoder .decode (Flux .concat (stringBuffer ("null" )),
244
244
ResolvableType .forType (Pojo .class ), MediaType .APPLICATION_JSON , Collections .emptyMap ());
245
245
246
246
StepVerifier .create (result ).expectComplete ().verify ();
247
247
}
248
248
249
249
@ Test // gh-27511
250
- public void noDefaultConstructor () {
250
+ void noDefaultConstructor () {
251
251
Flux <DataBuffer > input = Flux .from (stringBuffer ("{\" property1\" :\" foo\" ,\" property2\" :\" bar\" }" ));
252
252
253
253
testDecode (input , BeanWithNoDefaultConstructor .class , step -> step
@@ -268,7 +268,7 @@ void codecException() {
268
268
}
269
269
270
270
@ Test // SPR-15975
271
- public void customDeserializer () {
271
+ void customDeserializer () {
272
272
Mono <DataBuffer > input = stringBuffer ("{\" test\" : 1}" );
273
273
274
274
testDecode (input , TestObject .class , step -> step
@@ -289,7 +289,7 @@ void bigDecimalFlux() {
289
289
290
290
@ Test
291
291
@ SuppressWarnings ("unchecked" )
292
- public void decodeNonUtf8Encoding () {
292
+ void decodeNonUtf8Encoding () {
293
293
Mono <DataBuffer > input = stringBuffer ("{\" foo\" :\" bar\" }" , StandardCharsets .UTF_16 );
294
294
ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
295
295
@@ -302,7 +302,7 @@ public void decodeNonUtf8Encoding() {
302
302
303
303
@ Test
304
304
@ SuppressWarnings ("unchecked" )
305
- public void decodeNonUnicode () {
305
+ void decodeNonUnicode () {
306
306
Flux <DataBuffer > input = Flux .concat (stringBuffer ("{\" føø\" :\" bår\" }" , StandardCharsets .ISO_8859_1 ));
307
307
ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
308
308
@@ -315,7 +315,7 @@ public void decodeNonUnicode() {
315
315
316
316
@ Test
317
317
@ SuppressWarnings ("unchecked" )
318
- public void decodeMonoNonUtf8Encoding () {
318
+ void decodeMonoNonUtf8Encoding () {
319
319
Mono <DataBuffer > input = stringBuffer ("{\" foo\" :\" bar\" }" , StandardCharsets .UTF_16 );
320
320
ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
321
321
@@ -328,7 +328,7 @@ public void decodeMonoNonUtf8Encoding() {
328
328
329
329
@ Test
330
330
@ SuppressWarnings ("unchecked" )
331
- public void decodeAscii () {
331
+ void decodeAscii () {
332
332
Flux <DataBuffer > input = Flux .concat (stringBuffer ("{\" foo\" :\" bar\" }" , StandardCharsets .US_ASCII ));
333
333
ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
334
334
@@ -339,6 +339,15 @@ public void decodeAscii() {
339
339
null );
340
340
}
341
341
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
+
342
351
343
352
private Mono <DataBuffer > stringBuffer (String value ) {
344
353
return stringBuffer (value , StandardCharsets .UTF_8 );
0 commit comments