From 50e6ecadaec7a12ba4d89ea640c636dab65ee80e Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 8 Apr 2024 17:08:29 +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=8DjsonPath=E6=8F=90=E5=8F=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jmeter/processor/extract/JSONPathExtractConverter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/extract/JSONPathExtractConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/extract/JSONPathExtractConverter.java index 4d6e20b500..3dfb1cdfc1 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/extract/JSONPathExtractConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/extract/JSONPathExtractConverter.java @@ -2,6 +2,7 @@ package io.metersphere.api.parser.jmeter.processor.extract; import io.metersphere.project.api.processor.extract.JSONPathExtract; import io.metersphere.plugin.api.dto.ParameterConfig; +import org.apache.commons.lang3.StringUtils; import org.apache.jmeter.extractor.json.jsonpath.JSONPostProcessor; import org.apache.jmeter.save.SaveService; import org.apache.jmeter.testelement.TestElement; @@ -23,9 +24,11 @@ public class JSONPathExtractConverter extends ExtractConverter extractor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass(JSON_POST_PROCESSOR_GUI)); extractor.setRefNames(msExtract.getVariableName()); extractor.setJsonPathExpressions(msExtract.getExpression()); - extractor.setProperty("JSONPostProcessor.compute_concat", true); // 处理匹配多条等匹配规则 extractor.setMatchNumbers(parseResultMatchingRule(msExtract).toString()); + if (StringUtils.equals(extractor.getMatchNumbers(), "-1")) { + extractor.setComputeConcatenation(true); + } extractor.setEnabled(msExtract.getEnable()); hashTree.add(extractor); }