From becbe880970adedb1854652ff9c07b1652c46fc8 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 25 Jan 2022 11:09:15 +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=8Dssl=E8=AE=A4=E8=AF=81=E5=88=AB=E5=90=8D?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/dto/definition/request/ElementUtil.java | 3 ++- .../dto/definition/request/sampler/MsHTTPSamplerProxy.java | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java index 5323e2e36a..d246f1bbbd 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java @@ -580,7 +580,8 @@ public class ElementUtil { public static JSR223PreProcessor argumentsToProcessor(Arguments arguments) { JSR223PreProcessor processor = new JSR223PreProcessor(); processor.setEnabled(true); - processor.setName("scene variable"); + processor.setName("User Defined Variables"); + processor.setProperty("scriptLanguage", "beanshell"); processor.setProperty(TestElement.TEST_CLASS, JSR223PreProcessor.class.getName()); processor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI")); StringBuffer script = new StringBuffer(); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index 3454162623..3b7d5a1527 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -57,7 +57,6 @@ import java.net.URLEncoder; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.UUID; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -533,7 +532,7 @@ public class MsHTTPSamplerProxy extends MsTestElement { } if (StringUtils.isNotEmpty(this.alias)) { - String aliasVar = UUID.randomUUID().toString(); + String aliasVar = "User-Defined-KeyStore-" + this.alias.trim(); this.addArguments(httpSamplerTree, aliasVar, this.alias.trim()); // 校验 keystore commandService.checkKeyStore(msKeyStore.getPassword(), msKeyStore.getPath()); @@ -744,7 +743,7 @@ public class MsHTTPSamplerProxy extends MsTestElement { private void addArguments(HashTree tree, String key, String value) { Arguments arguments = new Arguments(); arguments.setEnabled(true); - arguments.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() + "-KeyStoreAlias" : "KeyStoreAlias"); + arguments.setName("User Defined KeyStoreAlias"); arguments.setProperty(TestElement.TEST_CLASS, Arguments.class.getName()); arguments.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("ArgumentsPanel")); arguments.addArgument(key, value, "=");