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
0af4f1cf21
commit
1a1884a04c
@ -518,4 +518,15 @@ public class UrlBuilderTest {
|
||||
final String build = httpUrl.build(CharsetUtil.UTF_8);
|
||||
assertEquals("/a:1/b:1/c:1/d:1/", build);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issueIAAOC1Test() {
|
||||
// 使用默认编码后,会先decode给定的URL,再encode
|
||||
UrlBuilder urlBuilder = UrlBuilder.ofHttp("http://localhost:9999/getReportDataList?goodsName=工业硫酸98%&conReportTypeId=1");
|
||||
assertEquals("http://localhost:9999/getReportDataList?goodsName=%E5%B7%A5%E4%B8%9A%E7%A1%AB%E9%85%B898%25&conReportTypeId=1", urlBuilder.build());
|
||||
|
||||
// 不指定编码,则保持原字符串
|
||||
urlBuilder = UrlBuilder.ofHttp("http://localhost:9999/getReportDataList?goodsName=工业硫酸98%&conReportTypeId=1", null);
|
||||
assertEquals("http://localhost:9999/getReportDataList?goodsName=工业硫酸98%&conReportTypeId=1", urlBuilder.build());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user