@@ -87,7 +87,7 @@ void testEmptyRef() {
8787 reference = new Reference ();
8888 reference .setHostDomain ("localhost" ); // must not produce NPE
8989 assertEquals ("localhost" , reference .getAuthority ());
90- reference .setHostPort (Integer . valueOf ( 4711 ) ); // must not produce NPE
90+ reference .setHostPort (4711 ); // must not produce NPE
9191 assertEquals ("localhost:4711" , reference .getAuthority ());
9292 reference .setUserInfo ("sdgj:skdfj" ); // must not produce NPE
9393 assertEquals ("sdgj:skdfj@localhost:4711" , reference .getAuthority ());
@@ -680,31 +680,17 @@ class TestFailures {
680680 "https://[192.168.0.1]vulndetector.com/" ,
681681 "https://[normal.com@]vulndetector.com/" ,
682682 "https://normal.com[user@vulndetector].com/" ,
683- "https://normal.com[@]vulndetector.com/"
684- })
685- void shouldFailWhenParsingIncorrectHosts (String url ) {
686- final Reference reference = new Reference (url );
687- assertThrows (IllegalArgumentException .class , reference ::getAuthority );
688- }
689-
690- @ ParameterizedTest
691- @ ValueSource (strings = {
683+ "https://normal.com[@]vulndetector.com/" ,
692684 "https://[1:2:3:4:5:6:7:8:9]" ,
693685 "https://[1::1::1]" ,
694686 "https://[1:2:3:]" ,
695687 "https://[ffff::127.0.0.4000]" ,
696688 "https://[0:0::vulndetector.com]:80" ,
697- "https://[2001:db8::vulndetector.com]" })
698- void shouldFailWhenParsingIncorrectIPv6Hosts (String url ) {
699- final Reference reference = new Reference (url );
700- assertThrows (IllegalArgumentException .class , reference ::getAuthority );
701- }
702-
703- @ ParameterizedTest
704- @ ValueSource (strings = {
689+ "https://[2001:db8::vulndetector.com]" ,
705690 "http://localhost:18:19" ,
706- "http://localhost:18ab" })
707- void shouldFailWhenParsingIncorrectPort (String url ) {
691+ "http://localhost:18ab"
692+ })
693+ void shouldFailWhenParsingIncorrectHosts (String url ) {
708694 final Reference reference = new Reference (url );
709695 assertThrows (IllegalArgumentException .class , reference ::getAuthority );
710696 }
0 commit comments