@@ -42,6 +42,7 @@ public class IntegrationTest {
42
42
private static final Logger logger = LoggerFactory .getLogger (OpenApiHandlerTest .class );
43
43
private static final String EXPECTED_ARRAY_RESULT ="3-4-5" ;
44
44
private static final String EXPECTED_MAP_RESULT ="id-name-001-Dog" ;
45
+ private static final String EXPECTED_NEGATIVE_RESULT = "failed" ;
45
46
46
47
private static Undertow server = null ;
47
48
@@ -294,6 +295,12 @@ static RoutingHandler setupRoutings() {
294
295
public void test_array_default_query_param_deserialization () throws Exception {
295
296
runTest ("/pets?limit=3&limit=4&limit=5" , EXPECTED_ARRAY_RESULT );
296
297
}
298
+
299
+ @ Test
300
+ /** negative test: query params are case sensitive */
301
+ public void test_mixed_case_array_default_query_param_deserialization () throws Exception {
302
+ runTest ("/pets?LIMIT=3&LIMIT=4&LIMIT=5" , EXPECTED_NEGATIVE_RESULT );
303
+ }
297
304
298
305
@ Test
299
306
public void test_array_no_explode_query_param_deserialization () throws Exception {
@@ -392,6 +399,14 @@ public void test_array_header_param_deserialization() throws Exception {
392
399
393
400
runTest ("/pets_header_array" , EXPECTED_ARRAY_RESULT , headers , Collections .emptyMap ());
394
401
}
402
+
403
+ @ Test
404
+ public void test_array_mixed_case_header_param_deserialization () throws Exception {
405
+ Map <String , String > headers = new HashMap <>();
406
+ headers .put ("PeTiD" , "3,4,5" );
407
+
408
+ runTest ("/pets_header_array" , EXPECTED_ARRAY_RESULT , headers , Collections .emptyMap ());
409
+ }
395
410
396
411
@ Test
397
412
public void test_object_simple_explode_header_param_deserialization () throws Exception {
@@ -400,27 +415,50 @@ public void test_object_simple_explode_header_param_deserialization() throws Exc
400
415
401
416
runTest ("/pets_header_obj_ep" , EXPECTED_MAP_RESULT , headers , Collections .emptyMap ());
402
417
}
418
+
419
+ @ Test
420
+ public void test_object_simple_explode_mixed_case_header_param_deserialization () throws Exception {
421
+ Map <String , String > headers = new HashMap <>();
422
+ headers .put ("PeTiD" , "id=001,name=Dog" );
423
+
424
+ runTest ("/pets_header_obj_ep" , EXPECTED_MAP_RESULT , headers , Collections .emptyMap ());
425
+ }
403
426
404
427
@ Test
405
428
public void test_object_simple_no_explode_header_param_deserialization () throws Exception {
406
429
Map <String , String > headers = new HashMap <>();
407
430
headers .put ("petId" , "id,001,name,Dog" );
408
431
runTest ("/pets_header_obj_no_ep" , EXPECTED_MAP_RESULT , headers , Collections .emptyMap ());
409
- }
410
-
411
- @ Test
432
+ }
433
+
434
+ @ Test
435
+ public void test_object_simple_no_explode_mixed_case_header_param_deserialization () throws Exception {
436
+ Map <String , String > headers = new HashMap <>();
437
+ headers .put ("PeTiD" , "id,001,name,Dog" );
438
+ runTest ("/pets_header_obj_no_ep" , EXPECTED_MAP_RESULT , headers , Collections .emptyMap ());
439
+ }
440
+
441
+ @ Test
412
442
public void test_array_cookie_param_deserialization () throws Exception {
413
443
Map <String , String > cookies = new HashMap <>();
414
444
cookies .put ("petId" , "3,4,5" );
415
445
runTest ("/pets_cookie_array" , EXPECTED_ARRAY_RESULT , Collections .emptyMap (), cookies );
416
446
}
447
+
448
+ @ Test
449
+ /*** negative test: cookie params are case sensitive */
450
+ public void test_array_mixed_case_cookie_param_deserialization () throws Exception {
451
+ Map <String , String > cookies = new HashMap <>();
452
+ cookies .put ("petid" , "3,4,5" );
453
+ runTest ("/pets_cookie_array" , EXPECTED_NEGATIVE_RESULT , Collections .emptyMap (), cookies );
454
+ }
417
455
418
456
@ Test
419
457
public void test_object_simple_no_explode_cookie_param_deserialization () throws Exception {
420
458
Map <String , String > cookies = new HashMap <>();
421
459
cookies .put ("petId" , "id,001,name,Dog" );
422
460
runTest ("/pets_cookie_obj_no_ep" , EXPECTED_MAP_RESULT , Collections .emptyMap (), cookies );
423
- }
461
+ }
424
462
425
463
public void runTest (String requestPath , String expectedValue , Map <String , String > headers , Map <String , String > cookies ) throws Exception {
426
464
final AtomicReference <ClientResponse > reference = new AtomicReference <>();
0 commit comments