mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 12:09:13 +08:00
fix(接口测试): 场景导入不是引用的处理
--user=郭雨琦 场景导入不是引用,如果是自定义,加引用环境
This commit is contained in:
parent
e2cc4b2b61
commit
5e8a556942
@ -400,13 +400,12 @@ public class ApiAutomationService {
|
||||
if (scenario == null || StringUtils.isEmpty(scenario.getScenarioDefinition())) {
|
||||
return;
|
||||
}
|
||||
if (scenario.getScenarioDefinition().contains("\"referenced\":\"REF\"")) {
|
||||
JSONObject element = JSON.parseObject(scenario.getScenarioDefinition());
|
||||
JSONArray hashTree = element.getJSONArray("hashTree");
|
||||
ApiScenarioImportUtil.formatHashTree(hashTree);
|
||||
setReferenced(hashTree,scenario.getVersionId(),scenario.getProjectId(),apiTestCaseMapper,apiDefinitionMapper,true);
|
||||
scenario.setScenarioDefinition(JSONObject.toJSONString(element));
|
||||
}
|
||||
JSONObject element = JSON.parseObject(scenario.getScenarioDefinition());
|
||||
JSONArray hashTree = element.getJSONArray("hashTree");
|
||||
ApiScenarioImportUtil.formatHashTree(hashTree);
|
||||
setReferenced(hashTree,scenario.getVersionId(),scenario.getProjectId(),apiTestCaseMapper,apiDefinitionMapper,true);
|
||||
scenario.setScenarioDefinition(JSONObject.toJSONString(element));
|
||||
|
||||
}
|
||||
|
||||
private void checkAndSetLatestVersion(String refId) {
|
||||
@ -1989,6 +1988,9 @@ public class ApiAutomationService {
|
||||
}
|
||||
}else{
|
||||
object.put("projectId", projectId);
|
||||
if(StringUtils.isEmpty(object.getString("url"))){
|
||||
object.put("isRefEnvironment",true);
|
||||
}
|
||||
}
|
||||
JSONObject environmentMap = object.getJSONObject("environmentMap");
|
||||
if (environmentMap != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user