mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
改进UrlQuery
对无参URL增加判断识别(issue#IBRVE4@Gitee)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package cn.hutool.http;
|
||||
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class IssueIBRVE4Test {
|
||||
@Test
|
||||
public void decodeParamMapNoParamTest() {
|
||||
// 参数值不存在分界标记等号时
|
||||
// 无参数值时
|
||||
final Map<String, List<String>> paramMap = HttpUtil.decodeParams("https://hutool.cn/api.action", CharsetUtil.CHARSET_UTF_8);
|
||||
assertEquals(0,paramMap.size());
|
||||
}
|
||||
@Test
|
||||
public void decodeParamMapListNoParamTest() {
|
||||
// 参数值不存在分界标记等号时
|
||||
// 无参数值时
|
||||
final Map<String, String> paramMap1 = HttpUtil.decodeParamMap("https://hutool.cn/api.action", CharsetUtil.CHARSET_UTF_8);
|
||||
assertEquals(0,paramMap1.size());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user