fix(接口测试): 修复IF逻辑控制器条件生成错误问题

https://github.com/metersphere/metersphere/issues/22366
This commit is contained in:
fit2-zhao 2023-03-01 15:51:23 +08:00 committed by fit2-zhao
parent d87a2d068c
commit 339d44d2f2
1 changed files with 5 additions and 2 deletions

View File

@ -102,8 +102,11 @@ public class MsIfController extends MsTestElement {
public String getCondition() {
String key = getContentValue();
String variable = (StringUtils.isEmpty(key) || key.equals(this.variable)) || key.startsWith("__V") ?
StringUtils.join("\"", this.variable, "\"") : StringUtils.join("vars.get('", key, "')");
String variable = (StringUtils.isEmpty(key) || key.equals(this.variable)) || key.startsWith("__")
? StringUtils.join("\"", this.variable, "\"")
: StringUtils.join("vars.get('", key, "')");
String operator = this.operator;
String value;
if (StringUtils.equals(operator, "<") || StringUtils.equals(operator, ">")) {