From bb8166f79d50555c0cd8a1eaa845c093ed597670 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 19 Jul 2023 10:09:28 +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=E7=89=B9=E6=AE=8Atcp=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=8E=AF=E5=A2=83=E6=89=A7=E8=A1=8C=E4=B8=8D?= =?UTF-8?q?=E8=B5=B7=E4=BD=9C=E7=94=A8=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=1027872 --user=王孝刚 【接口测试】tcpcase可以执行成功-加入到接口场景里执行失败 https://www.tapd.cn/55049933/s/1394930 --- .../main/java/io/metersphere/service/MockConfigService.java | 3 +++ .../src/business/definition/components/case/ApiCaseItem.vue | 1 + 2 files changed, 4 insertions(+) diff --git a/api-test/backend/src/main/java/io/metersphere/service/MockConfigService.java b/api-test/backend/src/main/java/io/metersphere/service/MockConfigService.java index e340495f10..c34cf729fa 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/MockConfigService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/MockConfigService.java @@ -883,6 +883,9 @@ public class MockConfigService { RequestMockParams requestMockParams = MockApiUtils.genRequestMockParamsFromHttpRequest(request, false); String urlSuffix = this.getUrlSuffix(project.getSystemId(), request); + LogUtil.info("Mock urlSuffix:{}", urlSuffix); + LogUtil.info("Mock requestHeaderMap:{}", requestHeaderMap); + LogUtil.info("Mock requestMockParams:{}", requestMockParams); List qualifiedApiList = apiDefinitionService.preparedUrl(project.getId(), method, urlSuffix, requestHeaderMap.get(MockApiHeaders.MOCK_API_RESOURCE_ID)); /* GET/DELETE 这种通过url穿参数的接口,在接口路径相同的情况下可能会出现这样的情况: diff --git a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue index bcfc0c1abe..192e41574b 100644 --- a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue +++ b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue @@ -575,6 +575,7 @@ export default { mergeRequestDocumentData(data.request); if (data.apiMethod !== 'SQL' && data.apiMethod !== 'DUBBO' && data.apiMethod !== 'dubbo://') { data.request.useEnvironment = this.environment; + data.request.environmentId = this.environment; } else { data.request.useEnvironment = data.request.environmentId; }