@@ -116,7 +116,7 @@ void canDecodeWithObjectMapperRegistrationForType() {
116
116
}
117
117
118
118
@ Test // SPR-15866
119
- public void canDecodeWithProvidedMimeType () {
119
+ void canDecodeWithProvidedMimeType () {
120
120
MimeType textJavascript = new MimeType ("text" , "javascript" , StandardCharsets .UTF_8 );
121
121
Jackson2JsonDecoder decoder = new Jackson2JsonDecoder (new ObjectMapper (), textJavascript );
122
122
@@ -222,15 +222,15 @@ void invalidData() {
222
222
}
223
223
224
224
@ Test // gh-22042
225
- public void decodeWithNullLiteral () {
225
+ void decodeWithNullLiteral () {
226
226
Flux <Object > result = this .decoder .decode (Flux .concat (stringBuffer ("null" )),
227
227
ResolvableType .forType (Pojo .class ), MediaType .APPLICATION_JSON , Collections .emptyMap ());
228
228
229
229
StepVerifier .create (result ).expectComplete ().verify ();
230
230
}
231
231
232
232
@ Test // gh-27511
233
- public void noDefaultConstructor () {
233
+ void noDefaultConstructor () {
234
234
Flux <DataBuffer > input = Flux .from (stringBuffer ("{\" property1\" :\" foo\" ,\" property2\" :\" bar\" }" ));
235
235
236
236
testDecode (input , BeanWithNoDefaultConstructor .class , step -> step
@@ -251,7 +251,7 @@ void codecException() {
251
251
}
252
252
253
253
@ Test // SPR-15975
254
- public void customDeserializer () {
254
+ void customDeserializer () {
255
255
Mono <DataBuffer > input = stringBuffer ("{\" test\" : 1}" );
256
256
257
257
testDecode (input , TestObject .class , step -> step
@@ -272,7 +272,7 @@ void bigDecimalFlux() {
272
272
273
273
@ Test
274
274
@ SuppressWarnings ("unchecked" )
275
- public void decodeNonUtf8Encoding () {
275
+ void decodeNonUtf8Encoding () {
276
276
Mono <DataBuffer > input = stringBuffer ("{\" foo\" :\" bar\" }" , StandardCharsets .UTF_16 );
277
277
ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
278
278
@@ -285,7 +285,7 @@ public void decodeNonUtf8Encoding() {
285
285
286
286
@ Test
287
287
@ SuppressWarnings ("unchecked" )
288
- public void decodeNonUnicode () {
288
+ void decodeNonUnicode () {
289
289
Flux <DataBuffer > input = Flux .concat (stringBuffer ("{\" føø\" :\" bår\" }" , StandardCharsets .ISO_8859_1 ));
290
290
ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
291
291
@@ -298,7 +298,7 @@ public void decodeNonUnicode() {
298
298
299
299
@ Test
300
300
@ SuppressWarnings ("unchecked" )
301
- public void decodeMonoNonUtf8Encoding () {
301
+ void decodeMonoNonUtf8Encoding () {
302
302
Mono <DataBuffer > input = stringBuffer ("{\" foo\" :\" bar\" }" , StandardCharsets .UTF_16 );
303
303
ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
304
304
@@ -311,7 +311,7 @@ public void decodeMonoNonUtf8Encoding() {
311
311
312
312
@ Test
313
313
@ SuppressWarnings ("unchecked" )
314
- public void decodeAscii () {
314
+ void decodeAscii () {
315
315
Flux <DataBuffer > input = Flux .concat (stringBuffer ("{\" foo\" :\" bar\" }" , StandardCharsets .US_ASCII ));
316
316
ResolvableType type = ResolvableType .forType (new ParameterizedTypeReference <Map <String , String >>() {});
317
317
@@ -322,6 +322,15 @@ public void decodeAscii() {
322
322
null );
323
323
}
324
324
325
+ @ Test
326
+ void cancelWhileDecoding () {
327
+ Flux <DataBuffer > input = Flux .just (
328
+ stringBuffer ("[{\" bar\" :\" b1\" ,\" foo\" :\" f1\" }," ).block (),
329
+ stringBuffer ("{\" bar\" :\" b2\" ,\" foo\" :\" f2\" }]" ).block ());
330
+
331
+ testDecodeCancel (input , ResolvableType .forClass (Pojo .class ), null , null );
332
+ }
333
+
325
334
326
335
private Mono <DataBuffer > stringBuffer (String value ) {
327
336
return stringBuffer (value , StandardCharsets .UTF_8 );
0 commit comments