refactor(接口测试): 公共脚本参数支持mock函数

This commit is contained in:
AgAngle 2024-04-15 12:46:39 +08:00 committed by 刘瑞斌
parent 62892fd496
commit d8c586a31d
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import io.metersphere.api.dto.ApiParamConfig;
import io.metersphere.api.parser.jmeter.JmeterTestElementParserHelper; import io.metersphere.api.parser.jmeter.JmeterTestElementParserHelper;
import io.metersphere.api.parser.jmeter.constants.JmeterAlias; import io.metersphere.api.parser.jmeter.constants.JmeterAlias;
import io.metersphere.api.parser.jmeter.constants.JmeterProperty; import io.metersphere.api.parser.jmeter.constants.JmeterProperty;
import io.metersphere.jmeter.mock.Mock;
import io.metersphere.plugin.api.constants.ElementProperty; import io.metersphere.plugin.api.constants.ElementProperty;
import io.metersphere.plugin.api.dto.ParameterConfig; import io.metersphere.plugin.api.dto.ParameterConfig;
import io.metersphere.project.api.KeyValueParam; import io.metersphere.project.api.KeyValueParam;
@ -92,7 +93,7 @@ public abstract class ScriptProcessorConverter extends MsProcessorConverter<Scri
Arguments arguments = JmeterTestElementParserHelper.getArguments(scriptProcessor.getName()); Arguments arguments = JmeterTestElementParserHelper.getArguments(scriptProcessor.getName());
for (KeyValueParam param : params) { for (KeyValueParam param : params) {
arguments.addArgument(param.getKey(), param.getValue(), "="); arguments.addArgument(param.getKey(), Mock.buildFunctionCallString(param.getValue()), "=");
} }
return arguments; return arguments;
} }