refactor(接口测试): 调整引用场景变量默认取值规则

Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
fit2-zhao 2023-08-30 10:31:23 +08:00 committed by fit2-zhao
parent 7cf999ea44
commit 1e6fed2e5a
1 changed files with 2 additions and 2 deletions

View File

@ -203,11 +203,11 @@ public class MsScenario extends MsTestElement {
this.setProjectId(scenario.getProjectId());
LinkedList<MsTestElement> sourceHashTree = JSONUtil.readValue(element.optString(ElementConstants.HASH_TREE));
// 场景变量
if (StringUtils.isNotEmpty(element.optString("variables")) && (this.variableEnable == null || this.variableEnable)) {
if (StringUtils.isNotEmpty(element.optString("variables"))) {
this.setVariables(JSONUtil.parseArray(element.optString("variables"), ScenarioVariable.class));
}
// 场景请求头
if (StringUtils.isNotEmpty(element.optString("headers")) && (this.variableEnable == null || this.variableEnable)) {
if (StringUtils.isNotEmpty(element.optString("headers"))) {
this.setHeaders(JSONUtil.parseArray(element.optString("headers"), KeyValue.class));
}
this.setHashTree(sourceHashTree);