From 55be24b5824aac5d445dfac42439bd58ddca6108 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 1 Apr 2022 18:20:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=9C=BA=E6=99=AF=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=88=9B=E5=BB=BA=E6=8E=A5=E5=8F=A3=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=97=B6=E7=9A=84=E5=93=8D=E5=BA=94=E4=BD=93=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 补充场景自动化导入创建接口定义时的响应体数据 --- .../dto/automation/parse/ApiScenarioImportUtil.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/dto/automation/parse/ApiScenarioImportUtil.java b/backend/src/main/java/io/metersphere/api/dto/automation/parse/ApiScenarioImportUtil.java index 7c13110279..5169b0c324 100644 --- a/backend/src/main/java/io/metersphere/api/dto/automation/parse/ApiScenarioImportUtil.java +++ b/backend/src/main/java/io/metersphere/api/dto/automation/parse/ApiScenarioImportUtil.java @@ -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")); + Mapmap = new HashMap<>(); + map.put("enable", true); + List> 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));