Skip to content

Commit 8878f06

Browse files
committed
🎨 修复单元测试代码
1 parent 22d288f commit 8878f06

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

weixin-java-common/src/test/java/me/chanjar/weixin/common/util/http/HttpResponseProxyTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
package me.chanjar.weixin.common.util.http;
22

33
import me.chanjar.weixin.common.error.WxErrorException;
4+
import me.chanjar.weixin.common.util.http.apache.ApacheHttpResponseProxy;
45
import org.testng.annotations.Test;
56

67
import static org.testng.Assert.*;
78

89
public class HttpResponseProxyTest {
910

11+
public final ApacheHttpResponseProxy httpResponseProxy = new ApacheHttpResponseProxy(null);
12+
1013
@Test
1114
public void testExtractFileNameFromContentString() throws WxErrorException {
1215
String content = "attachment; filename*=utf-8''%E6%B5%8B%E8%AF%95.xlsx; filename=\"��.xlsx\"";
13-
String filename = HttpResponseProxy.extractFileNameFromContentString(content);
16+
String filename = httpResponseProxy.extractFileNameFromContentString(content);
1417
assertNotNull(filename);
1518
assertEquals(filename, "测试.xlsx");
1619
}
@@ -19,7 +22,7 @@ public void testExtractFileNameFromContentString() throws WxErrorException {
1922
public void testExtractFileNameFromContentString_another() throws WxErrorException {
2023
String content = "attachment; filename*=utf-8''%E8%90%A5%E4%B8%9A%E6%89%A7%E7%85%A7.jpg; filename=\"����.jpg\"";
2124
// String content = "attachment; filename=\"����.jpg\"";
22-
String filename = HttpResponseProxy.extractFileNameFromContentString(content);
25+
String filename = httpResponseProxy.extractFileNameFromContentString(content);
2326
assertNotNull(filename);
2427
assertEquals(filename, "营业执照.jpg");
2528
}

0 commit comments

Comments
 (0)