From f9a33bf35ddc24b5ef20fdd1396361705a23b687 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 30 Jan 2024 16:26:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E8=B7=A8=E9=A1=B9=E7=9B=AE=E8=AF=81=E4=B9=A6=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=9A=94=E7=A6=BB=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fit2-zhao --- .../definition/request/sampler/MsHTTPSamplerProxy.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index 9ccad6f042..e7e2ad944e 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -135,10 +135,10 @@ public class MsHTTPSamplerProxy extends MsTestElement { } sampler.setProperty(TestElement.TEST_CLASS, HTTPSamplerProxy.class.getName()); sampler.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("HttpTestSampleGui")); - String resourceId = ElementUtil.setBaseParams(sampler, this.getParent(), config, this.getId(), this.getIndex()); - resourceId = StringUtils.isNotBlank(config.getReportId()) ? config.getReportId() : resourceId; - LogUtil.info("设置SSL证书配置{}", resourceId); - sampler.setProperty("MS-KEYSTORE-ID", resourceId); + String keystoreId = ElementUtil.setBaseParams(sampler, this.getParent(), config, this.getId(), this.getIndex()); + keystoreId = StringUtils.isNotBlank(config.getReportId()) ? config.getReportId() + "_" + keystoreId : keystoreId; + LogUtil.info("设置SSL证书配置{}", keystoreId); + sampler.setProperty("MS-KEYSTORE-ID", keystoreId); sampler.setMethod(this.getMethod()); sampler.setContentEncoding(StandardCharsets.UTF_8.name()); @@ -237,7 +237,7 @@ public class MsHTTPSamplerProxy extends MsTestElement { if (this.authManager != null && MsAuthManager.mechanismMap.containsKey(this.authManager.getVerification())) { this.authManager.setAuth(httpSamplerTree, this.authManager, sampler); } - addCertificate(config, httpSamplerTree, resourceId); + addCertificate(config, httpSamplerTree, keystoreId); if (httpConfig != null) { //根据配置增加全局前后至脚本 JMeterScriptUtil.setScriptByHttpConfig(httpConfig, httpSamplerTree, config, useEnvironment, this.getEnvironmentId(), false);