mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复HttpUtil.normalizeParams
规则问题(issue#IBQIYQ@Gitee)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package cn.hutool.http;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class IssueIBQIYQTest {
|
||||
@Test
|
||||
void normalizeParamsTest1() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", "");
|
||||
map.put("type", "4");
|
||||
String url = HttpUtil.toParams(map);
|
||||
Assertions.assertEquals("id=&type=4", url);
|
||||
url = HttpUtil.normalizeParams(url, null);
|
||||
Assertions.assertEquals("id=&type=4", url);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user