fix(接口测试): 补充场景自动化导入创建接口定义时的响应体数据

--user=郭雨琦
补充场景自动化导入创建接口定义时的响应体数据
This commit is contained in:
guoyuqi 2022-04-01 18:20:57 +08:00 committed by 刘瑞斌
parent 616bcdb51d
commit 55be24b582
1 changed files with 10 additions and 0 deletions

View File

@ -197,6 +197,16 @@ public class ApiScenarioImportUtil {
objectNew.remove("refType");
objectNew.remove("referenced");
test.setRequest(objectNew.toJSONString());
JSONObject obj = new JSONObject();
obj.put("type", object.get("protocol"));
obj.put("body", object.get("body"));
obj.put("headers", object.get("headers"));
Map<String,Boolean>map = new HashMap<>();
map.put("enable", true);
List<Map<String, Boolean>> list = new ArrayList<>();
list.add(map);
obj.put("statusCode", list);
test.setResponse(obj.toJSONString());
test.setUserId(SessionUtils.getUserId());
test.setLatest(true);
test.setOrder(apiDefinitionService.getImportNextOrder(projectId));