refactor(接口测试): 调整引用场景变量默认取值规则
Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
parent
7cf999ea44
commit
1e6fed2e5a
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue