修复中文乱码问题

This commit is contained in:
tanghc
2019-08-13 15:28:44 +08:00
parent aabc7b90a7
commit aa2b399ca8
6 changed files with 315 additions and 114 deletions

View File

@@ -142,6 +142,24 @@ public class AllInOneTest extends TestBase {
client.execute(requestBuilder);
}
/**
* 验证中文乱码问题
*/
public void testString() {
Client.RequestBuilder requestBuilder = new Client.RequestBuilder()
.method("story.string.get")
.version("1.0")
.bizContent(new BizContent().add("name", "name111"))
.httpMethod(HttpTool.HTTPMethod.GET)
.callback((requestInfo, responseData) -> {
JSONObject jsonObject = JSON.parseObject(responseData);
JSONObject data = jsonObject.getJSONObject("story_string_get_response");
Assert.assertEquals("海底小纵队", data.getString("name"));
});
client.execute(requestBuilder);
}
/**
* 限流测试根据路由id限流
*
@@ -161,7 +179,7 @@ public class AllInOneTest extends TestBase {
// 业务方法
Client.RequestBuilder requestBuilder = new Client.RequestBuilder()
.method("alipay.story.get")
.version("1.0")
.version("1.2")
.bizContent(new BizContent().add("id", "1").add("name", "葫芦娃"))
.httpMethod(HttpTool.HTTPMethod.GET);