refactor(接口测试): 优化sql前后置操作放置变量
This commit is contained in:
parent
2aab424c0b
commit
3748463caf
|
@ -90,15 +90,13 @@ public abstract class SqlProcessorConverter extends MsProcessorConverter<SQLProc
|
|||
processor.setProperty(JmeterProperty.SCRIPT_LANGUAGE, ScriptLanguageType.BEANSHELL.name().toLowerCase());
|
||||
|
||||
StringBuilder scriptBuilder = new StringBuilder();
|
||||
for (KeyValueParam keyValue : extractParams) {
|
||||
if (keyValue.isValid()) {
|
||||
String script = "vars.put(\"%s\", \"%s\");\n";
|
||||
extractParams.forEach(keyValue -> {
|
||||
String script = """
|
||||
vars.put("%s","${%s}");
|
||||
""";
|
||||
scriptBuilder.append(String.format(script, keyValue.getKey(), keyValue.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
processor.setProperty(JmeterProperty.SCRIPT, scriptBuilder.toString());
|
||||
|
||||
return processor;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue