From 38c1807e77c73954eab449c42694b8403bc6adf5 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 11 Nov 2022 11:42:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=B8=AD=E5=BC=95=E7=94=A8case=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=90=8C=E6=AD=A5=E6=98=BE=E7=A4=BA=E6=96=AD=E8=A8=80?= =?UTF-8?q?=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=1019575 --user=王孝刚 [接口测试]接口case修改断言规则后,场景中引用该case没有同步显示 https://www.tapd.cn/55049933/s/1294643 --- .../java/io/metersphere/service/MsHashTreeService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java b/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java index 2e55bd5e5f..81657b5933 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/MsHashTreeService.java @@ -72,6 +72,9 @@ public class MsHashTreeService { public static final String PROJECT_ID = "projectId"; public static final String ACTIVE = "active"; public static final String ENV_MAP = "environmentMap"; + private static final String PRE = "PRE"; + private static final String POST = "POST"; + private static final String ASSERTIONS = ElementConstants.ASSERTIONS; public void setHashTree(JSONArray hashTree) { // 将引用转成复制 @@ -145,9 +148,9 @@ public class MsHashTreeService { Map> groupMap = ElementUtil.group(sourceHashTree); Map> targetGroupMap = ElementUtil.group(refElement.optJSONArray(HASH_TREE)); - List pre = ElementUtil.mergeHashTree(groupMap.get("PRE"), targetGroupMap.get("PRE")); - List post = ElementUtil.mergeHashTree(groupMap.get("POST"), targetGroupMap.get("POST")); - List rules = ElementUtil.mergeHashTree(groupMap.get("ASSERTIONS"), targetGroupMap.get("ASSERTIONS")); + List pre = ElementUtil.mergeHashTree(groupMap.get(PRE), targetGroupMap.get(PRE)); + List post = ElementUtil.mergeHashTree(groupMap.get(POST), targetGroupMap.get(POST)); + List rules = ElementUtil.mergeHashTree(groupMap.get(ASSERTIONS), targetGroupMap.get(ASSERTIONS)); List step = new LinkedList<>(); if (CollectionUtils.isNotEmpty(pre)) { step.addAll(pre);