@@ -633,29 +633,17 @@ void buildAndExpandOpaque(ParserType parserType) {
633
633
@ ParameterizedTest // gh-33699
634
634
@ EnumSource (value = ParserType .class )
635
635
void schemeVariableMixedCase (ParserType parserType ) {
636
- URI uri = UriComponentsBuilder
637
- .fromUriString ("{TheScheme}://example.org" , parserType )
638
- .buildAndExpand (Map .of ("TheScheme" , "ws" ))
639
- .toUri ();
640
- assertThat (uri .toString ()).isEqualTo ("ws://example.org" );
641
-
642
- uri = UriComponentsBuilder
643
- .fromUriString ("{TheScheme}s://example.org" , parserType )
644
- .buildAndExpand (Map .of ("TheScheme" , "ws" ))
645
- .toUri ();
646
- assertThat (uri .toString ()).isEqualTo ("wss://example.org" );
647
636
648
- uri = UriComponentsBuilder
649
- .fromUriString ("s{TheScheme}://example.org" , parserType )
650
- .buildAndExpand (Map .of ("TheScheme" , "ws" ))
651
- .toUri ();
652
- assertThat (uri .toString ()).isEqualTo ("sws://example.org" );
637
+ BiConsumer <String , String > tester = (scheme , value ) -> {
638
+ URI uri = UriComponentsBuilder .fromUriString (scheme + "://example.org" , parserType )
639
+ .buildAndExpand (Map .of ("TheScheme" , value ))
640
+ .toUri ();
641
+ assertThat (uri .toString ()).isEqualTo ("wss://example.org" );
642
+ };
653
643
654
- uri = UriComponentsBuilder
655
- .fromUriString ("s{TheScheme}s://example.org" , parserType )
656
- .buildAndExpand (Map .of ("TheScheme" , "ws" ))
657
- .toUri ();
658
- assertThat (uri .toString ()).isEqualTo ("swss://example.org" );
644
+ tester .accept ("{TheScheme}" , "wss" );
645
+ tester .accept ("{TheScheme}s" , "ws" );
646
+ tester .accept ("ws{TheScheme}" , "s" );
659
647
}
660
648
661
649
@ ParameterizedTest
0 commit comments