From a3042270f4e668db28772f64eb4daeff0971081f Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 27 Jan 2022 14:36:08 +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=E5=8F=AA=E5=BC=95=E7=94=A8tcp=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E4=B8=8D=E9=80=89=E7=8E=AF=E5=A2=83=E5=B0=B1?= =?UTF-8?q?=E8=83=BD=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010027 --user=lyh 【接口测试】场景只引用tcp接口,不选环境就能调试 https://www.tapd.cn/55049933/s/1099906 --- .../api/exec/scenario/ApiScenarioEnvService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java index 5b9090ab50..2c0692bc28 100644 --- a/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java +++ b/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java @@ -88,11 +88,13 @@ public class ApiScenarioEnvService { ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = apiTestCaseService.get(tr.getId()); if (apiTestCaseWithBLOBs != null) { env.getProjectIds().add(apiTestCaseWithBLOBs.getProjectId()); + env.setFullUrl(false); } } else { ApiDefinition apiDefinition = apiDefinitionService.get(tr.getId()); if (apiDefinition != null) { env.getProjectIds().add(apiDefinition.getProjectId()); + env.setFullUrl(false); } } } else if (StringUtils.equals(tr.getType(), "scenario")) { @@ -117,6 +119,7 @@ public class ApiScenarioEnvService { } } else if (StringUtils.equals(tr.getType(), "JDBCSampler") || StringUtils.equals(tr.getType(), "TCPSampler")) { env.getProjectIds().add(tr.getProjectId()); + env.setFullUrl(false); } } if (StringUtils.equals(tr.getType(), "scenario")) { @@ -163,9 +166,11 @@ public class ApiScenarioEnvService { if (StringUtils.equals(tr.getRefType(), "CASE")) { ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = apiTestCaseService.get(tr.getId()); env.getProjectIds().add(apiTestCaseWithBLOBs.getProjectId()); + env.setFullUrl(false); } else { ApiDefinition apiDefinition = apiDefinitionService.get(tr.getId()); env.getProjectIds().add(apiDefinition.getProjectId()); + env.setFullUrl(false); } } else if (StringUtils.equals(tr.getType(), "scenario")) { if (tr.isEnable()) { @@ -193,6 +198,7 @@ public class ApiScenarioEnvService { } } else if (StringUtils.equals(tr.getType(), "JDBCSampler") || StringUtils.equals(tr.getType(), "TCPSampler")) { env.getProjectIds().add(tr.getProjectId()); + env.setFullUrl(false); } } if (StringUtils.equals(tr.getType(), "scenario")) {