From 1fb923d2af5bc4218a65bb1a8f9b1f70ba732328 Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Mon, 26 Feb 2024 14:10:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20au?= =?UTF-8?q?th=E9=85=8D=E7=BD=AE=E6=89=A7=E8=A1=8C=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/parser/jmeter/MsHTTPElementConverter.java | 7 +++---- .../api/parser/jmeter/body/MsFormDataBodyConverter.java | 5 ++++- .../api/parser/jmeter/body/MsWWWFormBodyConverter.java | 5 ++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java index e2e049a5ca..6b84894b92 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java @@ -96,7 +96,7 @@ public class MsHTTPElementConverter extends AbstractJmeterElementConverter { if (CollectionUtils.isEmpty(formValues)) { return; } - List validFormValues = formValues.stream().filter(FormDataKV::isValid).collect(Collectors.toList()); + List validFormValues = formValues.stream() + .filter(FormDataKV::getEnable) + .filter(FormDataKV::isValid) + .collect(Collectors.toList()); List fileFormValues = validFormValues.stream().filter(FormDataKV::isFile).collect(Collectors.toList()); List textFormValues = validFormValues.stream().filter(kv -> !kv.isFile()).collect(Collectors.toList()); sampler.setHTTPFiles(getHttpFileArg(fileFormValues)); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/body/MsWWWFormBodyConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/body/MsWWWFormBodyConverter.java index ef1def69c0..cd92efddab 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/body/MsWWWFormBodyConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/body/MsWWWFormBodyConverter.java @@ -16,7 +16,10 @@ public class MsWWWFormBodyConverter extends MsBodyConverter { @Override public void parse(HTTPSamplerProxy sampler, WWWFormBody body, ParameterConfig config) { List formValues = body.getFormValues(); - List validFormValues = formValues.stream().filter(WWWFormKV::isValid).collect(Collectors.toList()); + List validFormValues = formValues.stream() + .filter(WWWFormKV::getEnable) + .filter(WWWFormKV::isValid) + .collect(Collectors.toList()); sampler.setArguments(getArguments(validFormValues)); } }