mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-12 07:02:14 +08:00
4.0.3
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.gitee.sop.test;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
@@ -285,9 +286,11 @@ public class AllInOneTest extends TestBase {
|
||||
.bizContent(new BizContent().add("id", "1").add("name", "葫芦娃"))
|
||||
.httpMethod(HttpTool.HTTPMethod.GET)
|
||||
.callback((requestInfo, responseData) -> {
|
||||
int size = JSON.parseObject(responseData)
|
||||
.getJSONObject("bigdata_get_response")
|
||||
.getJSONArray("data").size();
|
||||
int size = Optional.ofNullable(JSON.parseObject(responseData))
|
||||
.flatMap(jsonObject -> Optional.ofNullable(jsonObject.getJSONObject("bigdata_get_response")))
|
||||
.flatMap(jsonObject -> Optional.ofNullable(jsonObject.getJSONArray("data")))
|
||||
.map(JSONArray::size)
|
||||
.orElse(0);
|
||||
Assert.assertEquals(size, 2000);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user