fix(接口测试): 接口场景导入har不加模块
--user=郭雨琦 --bug=1014743 --bug=1014736 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014743 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014736
This commit is contained in:
parent
ef15966ffd
commit
ce49e7964f
|
@ -53,30 +53,13 @@ public class HarScenarioParser extends HarScenarioAbstractParser<ScenarioImport>
|
|||
|
||||
// 生成场景对象
|
||||
List<ApiScenarioWithBLOBs> scenarioWithBLOBs = new LinkedList<>();
|
||||
parseScenarioWithBLOBs(scenarioWithBLOBs, msScenario, request);
|
||||
parseScenarioWithBLOBs(scenarioWithBLOBs, msScenario);
|
||||
scenarioImport.setData(scenarioWithBLOBs);
|
||||
return scenarioImport;
|
||||
}
|
||||
|
||||
private void parseScenarioWithBLOBs(List<ApiScenarioWithBLOBs> scenarioWithBLOBsList, MsScenario msScenario, ApiTestImportRequest request) {
|
||||
/*
|
||||
ApiScenarioModule selectModule = null;
|
||||
*/
|
||||
/*if (StringUtils.isNotBlank(request.getModuleId())) {
|
||||
selectModule = ApiScenarioImportUtil.getSelectModule(request.getModuleId());
|
||||
}
|
||||
ApiScenarioModule module = ApiScenarioImportUtil.buildModule(selectModule, msScenario.getName(), this.projectId);*/
|
||||
private void parseScenarioWithBLOBs(List<ApiScenarioWithBLOBs> scenarioWithBLOBsList, MsScenario msScenario) {
|
||||
ApiScenarioWithBLOBs scenarioWithBLOBs = parseScenario(msScenario);
|
||||
/*if (module != null) {
|
||||
scenarioWithBLOBs.setApiScenarioModuleId(module.getId());
|
||||
if (selectModule != null) {
|
||||
String selectModulePath = ApiScenarioImportUtil.getSelectModulePath(selectModule.getName(), selectModule.getParentId());
|
||||
scenarioWithBLOBs.setModulePath(selectModulePath + "/" + module.getName());
|
||||
} else {
|
||||
scenarioWithBLOBs.setModulePath("/" + module.getName());
|
||||
}
|
||||
}*/
|
||||
scenarioWithBLOBs.setModulePath("/" + msScenario.getName());
|
||||
scenarioWithBLOBsList.add(scenarioWithBLOBs);
|
||||
}
|
||||
|
||||
|
|
|
@ -790,6 +790,9 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
|
|||
}
|
||||
}
|
||||
|
||||
if (optionData.isEmpty()) {
|
||||
moduleMap = new HashMap<>();
|
||||
}
|
||||
return getUpdateApiModuleDTO(moduleMap, toUpdateList, optionData);
|
||||
}
|
||||
|
||||
|
|
|
@ -516,7 +516,11 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
|
|||
setModule(optionData, moduleMap, pidChildrenMap, idPathMap, idModuleMap, chooseModule);
|
||||
List<String> names = optionData.stream().map(ApiScenario::getName).collect(Collectors.toList());
|
||||
//系统内重复的数据
|
||||
List<ApiScenarioWithBLOBs> repeatApiScenarioWithBLOBs = extApiScenarioMapper.selectRepeatByBLOBs(names, projectId);
|
||||
List<ApiScenarioWithBLOBs> repeatAllScenarioWithBLOBs = extApiScenarioMapper.selectRepeatByBLOBs(names, projectId);
|
||||
ArrayList<ApiScenarioWithBLOBs> repeatApiScenarioWithBLOBs = repeatAllScenarioWithBLOBs.stream().collect(
|
||||
Collectors.collectingAndThen(
|
||||
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(t -> t.getName() + t.getModulePath()))), ArrayList::new)
|
||||
);
|
||||
|
||||
Map<String, ApiScenarioWithBLOBs> nameModuleMap = null;
|
||||
Map<String, ApiScenarioWithBLOBs> repeatDataMap = null;
|
||||
|
@ -559,6 +563,9 @@ public class ApiScenarioModuleService extends NodeTreeService<ApiScenarioModuleD
|
|||
}
|
||||
}
|
||||
|
||||
if (optionData.isEmpty()) {
|
||||
moduleMap = new HashMap<>();
|
||||
}
|
||||
UpdateScenarioModuleDTO updateScenarioModuleDTO = new UpdateScenarioModuleDTO();
|
||||
updateScenarioModuleDTO.setModuleList(new ArrayList<>(moduleMap.values()));
|
||||
updateScenarioModuleDTO.setNeedUpdateList(toUpdateList);
|
||||
|
|
Loading…
Reference in New Issue