mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
3.0.0
This commit is contained in:
@@ -2,9 +2,12 @@ package com.gitee.sop.test;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.junit.Assert;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
@@ -247,6 +250,23 @@ public class AllInOneTest extends TestBase {
|
||||
client.execute(requestBuilder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件
|
||||
*/
|
||||
public void testDownloadFile() throws IOException {
|
||||
Client.RequestBuilder requestBuilder = new Client.RequestBuilder()
|
||||
.method("story.download")
|
||||
.version("1.0")
|
||||
.bizContent(new BizContent().add("id",1).add("name","Jim"))
|
||||
.httpMethod(HttpTool.HTTPMethod.GET);
|
||||
|
||||
// 文件流
|
||||
InputStream download = client.download(requestBuilder);
|
||||
String content = IOUtils.toString(download, "UTF-8");
|
||||
System.out.println("下载文件内容:" + content);
|
||||
Assert.assertEquals(content, "spring.profiles.active=dev");
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证中文乱码问题
|
||||
*/
|
||||
|
Reference in New Issue
Block a user