fix(接口测试): 修复jmeter函数无法运行的缺陷

--bug=1014752 --user=王孝刚 【接口测试】github#15599,Jmeter 函数 ${javaScript}
无法执行,导致其他参数获取变量 https://www.tapd.cn/55049933/s/1198511
This commit is contained in:
wxg0103 2022-07-11 11:33:33 +08:00 committed by f2c-ci-robot[bot]
parent 1401b27d2e
commit 7495be1c9b
1 changed files with 2 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import io.metersphere.jmeter.utils.ScriptEngineUtils;
import io.metersphere.utils.LoggerUtil; import io.metersphere.utils.LoggerUtil;
import lombok.Data; import lombok.Data;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
@ -96,7 +97,7 @@ public class Body {
if (StringUtils.isNotBlank(this.type) && StringUtils.equals(this.type, "JSON")) { if (StringUtils.isNotBlank(this.type) && StringUtils.equals(this.type, "JSON")) {
if (StringUtils.isNotEmpty(this.format) && this.getJsonSchema() != null if (StringUtils.isNotEmpty(this.format) && this.getJsonSchema() != null
&& "JSON-SCHEMA".equals(this.format)) { && "JSON-SCHEMA".equals(this.format)) {
this.raw = JSONSchemaRunTest.getJson(JSON.toJSONString(this.getJsonSchema())); this.raw = StringEscapeUtils.unescapeJava(JSONSchemaRunTest.getJson(JSON.toJSONString(this.getJsonSchema())));
} else { } else {
try { try {
if (StringUtils.isNotEmpty(this.getRaw())) { if (StringUtils.isNotEmpty(this.getRaw())) {