fix(接口测试): 接口用例导入过滤导入的文件没有case的情况

--user=郭雨琦
This commit is contained in:
guoyuqi 2022-07-12 12:06:25 +08:00 committed by xiaomeinvG
parent 1bac526e0d
commit 8894df906b
1 changed files with 3 additions and 0 deletions

View File

@ -818,6 +818,9 @@ public class ApiDefinitionService {
}
private void importCase(ApiDefinitionWithBLOBs apiDefinition, ApiTestCaseMapper apiTestCaseMapper, List<ApiTestCaseWithBLOBs> caseList) {
if (caseList == null || caseList.isEmpty()) {
return;
}
for (ApiTestCaseWithBLOBs apiTestCaseWithBLOBs : caseList) {
apiTestCaseWithBLOBs.setApiDefinitionId(apiDefinition.getId());
apiTestCaseWithBLOBs.setVersionId(apiDefinition.getVersionId());