mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
add test
This commit is contained in:
parent
4e46606e60
commit
59202e8061
@ -204,4 +204,10 @@ public class UrlBuilderTest {
|
||||
final UrlBuilder urlBuilder = UrlBuilder.ofHttp("http://a.com/aaa bbb.html", CharsetUtil.CHARSET_UTF_8);
|
||||
Assert.assertEquals("http://a.com/aaa%20bbb.html", urlBuilder.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dotEncodeTest(){
|
||||
final UrlBuilder urlBuilder = UrlBuilder.ofHttp("http://xtbgyy.digitalgd.com.cn/ebus/../../..", CharsetUtil.CHARSET_UTF_8);
|
||||
Assert.assertEquals("http://xtbgyy.digitalgd.com.cn/ebus/../../..", urlBuilder.toString());
|
||||
}
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ public class HttpConnection {
|
||||
final URLConnection conn = openConnection();
|
||||
if (false == conn instanceof HttpURLConnection) {
|
||||
// 防止其它协议造成的转换异常
|
||||
throw new HttpException("'{}' is not a http connection, make sure URL is format for http.", conn.getClass().getName());
|
||||
throw new HttpException("'{}' of URL [{}] is not a http connection, make sure URL is format for http.", conn.getClass().getName(), this.url);
|
||||
}
|
||||
|
||||
return (HttpURLConnection) conn;
|
||||
|
@ -143,4 +143,5 @@ public class HttpRequestTest {
|
||||
HttpResponse execute = get.execute();
|
||||
Console.log(execute.body());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user