From 2bc5a96b6faf8792ee7a6aad04cf20c4aafbabae Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Thu, 23 Feb 2023 12:08:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=95=E7=94=A8case=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1022544 --user=王孝刚 【接口测试】github#21594,swagger、postman、har格式导入的接口没有配置默认超时时间,导致修改case的超时时间后,场景中引用的case也不能同步修改超时时间 https://www.tapd.cn/55049933/s/1341836 --- .../io/metersphere/api/service/MsHashTreeService.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/service/MsHashTreeService.java b/backend/src/main/java/io/metersphere/api/service/MsHashTreeService.java index 225ff050c4..e31b9fd1b9 100644 --- a/backend/src/main/java/io/metersphere/api/service/MsHashTreeService.java +++ b/backend/src/main/java/io/metersphere/api/service/MsHashTreeService.java @@ -65,6 +65,12 @@ public class MsHashTreeService { public static final String ACTIVE = "active"; public static final String ENV_MAP = "environmentMap"; + private static final String CONNECT_TIMEOUT = "connectTimeout"; + private static final String RESPONSE_TIMEOUT = "responseTimeout"; + private static final String FOLLOW_REDIRECTS = "followRedirects"; + private static final String AUTO_REDIRECTS = "autoRedirects"; + private static final String ALIAS = "alias"; + public void setHashTree(JSONArray hashTree) { // 将引用转成复制 if (CollectionUtils.isEmpty(hashTree)) { @@ -197,6 +203,11 @@ public class MsHashTreeService { element.put(AUTH_MANAGER, refElement.get(AUTH_MANAGER)); element.put(ARGUMENTS, refElement.get(ARGUMENTS)); element.put(PROJECT_ID, apiTestCase.getProjectId()); + element.put(CONNECT_TIMEOUT, refElement.get(CONNECT_TIMEOUT)); + element.put(RESPONSE_TIMEOUT, refElement.get(RESPONSE_TIMEOUT)); + element.put(FOLLOW_REDIRECTS, refElement.get(FOLLOW_REDIRECTS)); + element.put(AUTO_REDIRECTS, refElement.get(AUTO_REDIRECTS)); + element.put(ALIAS, refElement.get(ALIAS)); if (array != null) { JSONArray sourceHashTree = element.getJSONArray(HASH_TREE); Map> groupMap = ElementUtil.group(sourceHashTree);