@@ -16,7 +16,7 @@ public void shouldPercentEncodeMap()
1616 params .put ("key with spaces" , "value with spaces" );
1717 params .put ("&symbols!" , "#!" );
1818
19- String expected = "key=value&key%20with%20spaces =value%20with%20spaces &%26symbols%21=%23%21" ;
19+ String expected = "key=value&key+with+spaces =value+with+spaces &%26symbols%21=%23%21" ;
2020 assertEquals (expected , URLUtils .formURLEncodeMap (params ));
2121 }
2222
@@ -41,7 +41,7 @@ public void shouldPercentDecodeString()
4141 {
4242 String toDecode = "this+is+a+test+%26%5E" ;
4343 String expected = "this is a test &^" ;
44- assertEquals (expected , URLUtils .percentDecode (toDecode ));
44+ assertEquals (expected , URLUtils .urlDecodeWrapper (toDecode ));
4545 }
4646
4747 @ Test
@@ -50,7 +50,7 @@ public void shouldEncodeAllSpecialCharacters()
5050 String plain = "!*'();:@&=+$,/?#[]" ;
5151 String encoded = "%21%2A%27%28%29%3B%3A%40%26%3D%2B%24%2C%2F%3F%23%5B%5D" ;
5252 assertEquals (encoded , URLUtils .percentEncode (plain ));
53- assertEquals (plain , URLUtils .percentDecode (encoded ));
53+ assertEquals (plain , URLUtils .urlDecodeWrapper (encoded ));
5454 }
5555
5656 @ Test
@@ -79,7 +79,7 @@ public void shouldThrowExceptionIfStringToEncodeIsNull()
7979 public void shouldThrowExceptionIfStringToDecodeIsNull ()
8080 {
8181 String toDecode = null ;
82- URLUtils .percentDecode (toDecode );
82+ URLUtils .urlDecodeWrapper (toDecode );
8383 }
8484
8585 @ Test (expected = IllegalArgumentException .class )
@@ -103,7 +103,7 @@ public void shouldAppendNothingToQuerystringIfGivenEmptyMap()
103103 public void shouldAppendParametersToSimpleUrl ()
104104 {
105105 String url = "http://www.example.com" ;
106- String expectedUrl = "http://www.example.com?param1=value1¶m2=value%20with%20spaces " ;
106+ String expectedUrl = "http://www.example.com?param1=value1¶m2=value+with+spaces " ;
107107
108108 Map <String , String > params = new HashMap <String , String >();
109109 params .put ("param1" , "value1" );
@@ -117,7 +117,7 @@ public void shouldAppendParametersToSimpleUrl()
117117 public void shouldAppendParametersToUrlWithQuerystring ()
118118 {
119119 String url = "http://www.example.com?already=present" ;
120- String expectedUrl = "http://www.example.com?already=present¶m1=value1¶m2=value%20with%20spaces " ;
120+ String expectedUrl = "http://www.example.com?already=present¶m1=value1¶m2=value+with+spaces " ;
121121
122122 Map <String , String > params = new HashMap <String , String >();
123123 params .put ("param1" , "value1" );
@@ -142,6 +142,6 @@ public void shouldDecodePlusSymbol()
142142 String encoded = "oauth_verifier=7aEP%2BjNAwvjc0mjhqg0nuXPf" ;
143143 String expected = "oauth_verifier=7aEP+jNAwvjc0mjhqg0nuXPf" ;
144144
145- Assert .assertEquals (expected , URLUtils .percentDecode (encoded ));
145+ Assert .assertEquals (expected , URLUtils .urlDecodeWrapper (encoded ));
146146 }
147147}
0 commit comments