From 94dcf2158d97edf3ce84f3cf72aa30042366de4e Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 25 Oct 2022 19:01:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=85=A5har=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AF=B7=E6=B1=82=E4=B8=8D=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E7=8E=AF=E5=A2=83=EF=BC=8C=E6=89=A7=E8=A1=8C=E6=97=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=80=89=E6=8B=A9=E7=8E=AF=E5=A2=83=E7=9A=84?= =?UTF-8?q?=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018879 --user=王孝刚 【接口测试】github#18808。接口自动化导入har包后,不勾选引用环境,执行时还提示要选择运行环境 https://www.tapd.cn/55049933/s/1277068 --- .../exec/scenario/ApiScenarioEnvService.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java index d3c5ebbbcb..2134ca6c42 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/scenario/ApiScenarioEnvService.java @@ -10,24 +10,23 @@ import io.metersphere.api.dto.definition.request.MsScenario; import io.metersphere.api.dto.definition.request.ParameterConfig; import io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy; import io.metersphere.api.dto.scenario.environment.EnvironmentConfig; -import io.metersphere.service.definition.ApiDefinitionService; -import io.metersphere.base.mapper.plan.TestPlanApiScenarioMapper; -import io.metersphere.commons.utils.GenerateHashTreeUtil; import io.metersphere.base.domain.*; -import io.metersphere.base.mapper.*; +import io.metersphere.base.mapper.ApiScenarioMapper; +import io.metersphere.base.mapper.ApiTestCaseMapper; +import io.metersphere.base.mapper.ApiTestEnvironmentMapper; +import io.metersphere.base.mapper.ProjectMapper; +import io.metersphere.base.mapper.plan.TestPlanApiScenarioMapper; import io.metersphere.commons.constants.ApiRunMode; import io.metersphere.commons.constants.ElementConstants; import io.metersphere.commons.constants.MsTestElementConstants; import io.metersphere.commons.exception.MSException; -import io.metersphere.commons.utils.CommonBeanFactory; -import io.metersphere.commons.utils.JSON; -import io.metersphere.commons.utils.LogUtil; +import io.metersphere.commons.utils.*; import io.metersphere.dto.RunModeConfigDTO; import io.metersphere.environment.service.BaseEnvGroupProjectService; import io.metersphere.environment.service.BaseEnvironmentService; import io.metersphere.i18n.Translator; import io.metersphere.plugin.core.MsTestElement; -import io.metersphere.commons.utils.JSONUtil; +import io.metersphere.service.definition.ApiDefinitionService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -141,7 +140,7 @@ public class ApiScenarioEnvService { MsHTTPSamplerProxy httpSamplerProxy = (MsHTTPSamplerProxy) testElement; if (httpSamplerProxy.isCustomizeReq()) { env.getProjectIds().add(httpSamplerProxy.getProjectId()); - env.setFullUrl(httpSamplerProxy.getIsRefEnvironment() == null ? true : httpSamplerProxy.getIsRefEnvironment()); + env.setFullUrl(httpSamplerProxy.getIsRefEnvironment() == null ? true : !httpSamplerProxy.getIsRefEnvironment()); } else if (!StringUtils.equalsIgnoreCase(httpSamplerProxy.getReferenced(), "Created") || (httpSamplerProxy.getIsRefEnvironment() != null && httpSamplerProxy.getIsRefEnvironment())) { env.getProjectIds().add(httpSamplerProxy.getProjectId()); env.setFullUrl(false);