mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add test
This commit is contained in:
@@ -539,6 +539,9 @@ public class HttpUtil {
|
||||
* @since 4.5.2
|
||||
*/
|
||||
public static String normalizeParams(String paramPart, Charset charset) {
|
||||
if(StrUtil.isEmpty(paramPart)){
|
||||
return paramPart;
|
||||
}
|
||||
final StrBuilder builder = StrBuilder.create(paramPart.length() + 16);
|
||||
final int len = paramPart.length();
|
||||
String name = null;
|
||||
|
@@ -302,6 +302,12 @@ public class HttpUtilTest {
|
||||
Assert.assertEquals("%E5%8F%82%E6%95%B0", encodeResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void normalizeBlankParamsTest() {
|
||||
String encodeResult = HttpUtil.normalizeParams("", CharsetUtil.CHARSET_UTF_8);
|
||||
Assert.assertEquals("", encodeResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMimeTypeTest() {
|
||||
String mimeType = HttpUtil.getMimeType("aaa.aaa");
|
||||
|
Reference in New Issue
Block a user