fix: 旧版本导出文件接口定义导入失败
This commit is contained in:
parent
cda0b0d1bf
commit
b6faf61f73
|
@ -58,14 +58,16 @@ public class MsDefinitionParser extends MsAbstractParser<ApiDefinitionImport> {
|
|||
private ApiDefinitionImport parseMsFormat(String testStr, ApiTestImportRequest importRequest) {
|
||||
ApiDefinitionImport apiDefinitionImport = JSON.parseObject(testStr, ApiDefinitionImport.class);
|
||||
Map<String, List<ApiTestCaseWithBLOBs>> caseMap = new HashMap<>();
|
||||
apiDefinitionImport.getCases().forEach(item -> {
|
||||
List<ApiTestCaseWithBLOBs> caseList = caseMap.get(item.getApiDefinitionId());
|
||||
if (caseList == null) {
|
||||
caseList = new ArrayList<>();
|
||||
caseMap.put(item.getApiDefinitionId(), caseList);
|
||||
}
|
||||
caseList.add(item);
|
||||
});
|
||||
if (apiDefinitionImport.getCases() != null) {
|
||||
apiDefinitionImport.getCases().forEach(item -> {
|
||||
List<ApiTestCaseWithBLOBs> caseList = caseMap.get(item.getApiDefinitionId());
|
||||
if (caseList == null) {
|
||||
caseList = new ArrayList<>();
|
||||
caseMap.put(item.getApiDefinitionId(), caseList);
|
||||
}
|
||||
caseList.add(item);
|
||||
});
|
||||
}
|
||||
apiDefinitionImport.getData().forEach(apiDefinition -> {
|
||||
parseApiDefinition(apiDefinition, importRequest, caseMap);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue