@@ -61,7 +61,7 @@ protected Reference getReference() {
6161 * Test addition methods.
6262 */
6363 @ Test
64- void testAdditions () throws Exception {
64+ void testAdditions () {
6565 final Reference ref = new Reference ("http://restlet.org" );
6666 ref .addQueryParameter ("abc" , "123" );
6767 assertEquals ("http://restlet.org?abc=123" , ref .toString ());
@@ -618,7 +618,7 @@ void testTargetRef() {
618618 * Test references that are unequal.
619619 */
620620 @ Test
621- void testUnEquals () throws Exception {
621+ void testUnEquals () {
622622 final String uri1 = "http://restlet.org/" ;
623623 final String uri2 = "http://restlet.net/" ;
624624 final Reference ref1 = new Reference (uri1 );
@@ -682,8 +682,9 @@ class TestFailures {
682682 "https://normal.com[user@vulndetector].com/" ,
683683 "https://normal.com[@]vulndetector.com/"
684684 })
685- void shouldFailWhenParsingIncorrectHosts (String reference ) {
686- assertThrows (IllegalArgumentException .class , () -> new Reference (reference ).getAuthority ());
685+ void shouldFailWhenParsingIncorrectHosts (String url ) {
686+ final Reference reference = new Reference (url );
687+ assertThrows (IllegalArgumentException .class , reference ::getAuthority );
687688 }
688689
689690 @ ParameterizedTest
@@ -694,24 +695,27 @@ void shouldFailWhenParsingIncorrectHosts(String reference) {
694695 "https://[ffff::127.0.0.4000]" ,
695696 "https://[0:0::vulndetector.com]:80" ,
696697 "https://[2001:db8::vulndetector.com]" })
697- void shouldFailWhenParsingIncorrectIPv6Hosts (String reference ) {
698- assertThrows (IllegalArgumentException .class , () -> new Reference (reference ).getAuthority ());
698+ void shouldFailWhenParsingIncorrectIPv6Hosts (String url ) {
699+ final Reference reference = new Reference (url );
700+ assertThrows (IllegalArgumentException .class , reference ::getAuthority );
699701 }
700702
701703 @ ParameterizedTest
702704 @ ValueSource (strings = {
703705 "http://localhost:18:19" ,
704706 "http://localhost:18ab" })
705- void shouldFailWhenParsingIncorrectPort (String reference ) {
706- assertThrows (IllegalArgumentException .class , () -> new Reference (reference ).getAuthority ());
707+ void shouldFailWhenParsingIncorrectPort (String url ) {
708+ final Reference reference = new Reference (url );
709+ assertThrows (IllegalArgumentException .class , reference ::getAuthority );
707710 }
708711
709712 @ ParameterizedTest
710713 @ ValueSource (strings = {
711714 "https>://vulndetector.com/path" ,
712715 "https%25://vulndetector.com/path" })
713- void shouldFailWhenParsingIncorrectScheme (String reference ) {
714- assertThrows (IllegalArgumentException .class , () -> new Reference (reference ).getScheme ());
716+ void shouldFailWhenParsingIncorrectScheme (String url ) {
717+ final Reference reference = new Reference (url );
718+ assertThrows (IllegalArgumentException .class , reference ::getScheme );
715719 }
716720 }
717721}
0 commit comments