From 83ca47c2424015a29e0a1678836e4326da0fd4bb Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Tue, 22 Oct 2024 15:35:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=89=A7=E8=A1=8C=E8=8E=B7=E5=8F=96=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E6=B1=A0=EF=BC=8C=E6=B2=A1=E6=9C=89=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E9=BB=98=E8=AE=A4=E8=B5=84=E6=BA=90=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1047796 --user=陈建星 【接口测试】-批量执行CASE、场景时,默认选择的资源池不是项目指定的执行资源池 https://www.tapd.cn/55049933/s/1595627 --- .../java/io/metersphere/api/service/ApiTestService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java index e59223af14..44598c68b3 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/ApiTestService.java @@ -8,6 +8,7 @@ import io.metersphere.plugin.api.dto.ApiPluginSelectOption; import io.metersphere.plugin.api.spi.AbstractApiPlugin; import io.metersphere.plugin.api.spi.AbstractProtocolPlugin; import io.metersphere.project.api.KeyValueParam; +import io.metersphere.project.domain.ProjectApplication; import io.metersphere.project.dto.CommonScriptInfo; import io.metersphere.project.dto.customfunction.CustomFunctionDTO; import io.metersphere.project.dto.environment.EnvironmentConfig; @@ -134,7 +135,12 @@ public class ApiTestService { } public String getPoolId(String projectId) { + // 查询接口默认资源池 + ProjectApplication resourcePoolConfig = projectApplicationService.getByType(projectId, ProjectApplicationType.API.API_RESOURCE_POOL_ID.name()); Map configMap = new HashMap<>(); + if (resourcePoolConfig != null && StringUtils.isNotBlank(resourcePoolConfig.getTypeValue())) { + configMap.put(ProjectApplicationType.API.API_RESOURCE_POOL_ID.name(), resourcePoolConfig.getTypeValue()); + } projectApplicationService.putResourcePool(projectId, configMap, "apiTest"); if (configMap.isEmpty()) { return null;