mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 10:38:42 +08:00 
			
		
		
		
	🎨 修复单元测试代码
This commit is contained in:
		| @ -1,16 +1,19 @@ | ||||
| package me.chanjar.weixin.common.util.http; | ||||
|  | ||||
| import me.chanjar.weixin.common.error.WxErrorException; | ||||
| import me.chanjar.weixin.common.util.http.apache.ApacheHttpResponseProxy; | ||||
| import org.testng.annotations.Test; | ||||
|  | ||||
| import static org.testng.Assert.*; | ||||
|  | ||||
| public class HttpResponseProxyTest { | ||||
|  | ||||
|   public final ApacheHttpResponseProxy httpResponseProxy = new ApacheHttpResponseProxy(null); | ||||
|  | ||||
|   @Test | ||||
|   public void testExtractFileNameFromContentString() throws WxErrorException { | ||||
|     String content = "attachment; filename*=utf-8''%E6%B5%8B%E8%AF%95.xlsx; filename=\"æµ<EFBFBD>è¯<EFBFBD>.xlsx\""; | ||||
|     String filename = HttpResponseProxy.extractFileNameFromContentString(content); | ||||
|     String filename = httpResponseProxy.extractFileNameFromContentString(content); | ||||
|     assertNotNull(filename); | ||||
|     assertEquals(filename, "测试.xlsx"); | ||||
|   } | ||||
| @ -19,7 +22,7 @@ public class HttpResponseProxyTest { | ||||
|   public void testExtractFileNameFromContentString_another() throws WxErrorException { | ||||
|     String content = "attachment; filename*=utf-8''%E8%90%A5%E4%B8%9A%E6%89%A7%E7%85%A7.jpg; filename=\"è<EFBFBD>¥ä¸<EFBFBD>æ<EFBFBD>§ç<EFBFBD>§.jpg\""; | ||||
| //    String content = "attachment; filename=\"è<>¥ä¸<C3A4>æ<EFBFBD>§ç<C2A7>§.jpg\""; | ||||
|     String filename = HttpResponseProxy.extractFileNameFromContentString(content); | ||||
|     String filename = httpResponseProxy.extractFileNameFromContentString(content); | ||||
|     assertNotNull(filename); | ||||
|     assertEquals(filename, "营业执照.jpg"); | ||||
|   } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Binary Wang
					Binary Wang