fix(接口测试): 修复场景批量执行,显示环境错误的缺陷

--bug=1029087 --user=王孝刚 【接口测试】历史场景-复制当前项目场景不存在-批量执行-项目显示错误
https://www.tapd.cn/55049933/s/1412631
This commit is contained in:
wxg0103 2023-09-05 14:07:40 +08:00 committed by fit2-zhao
parent be2021e5b8
commit 261be2818d

View File

@ -2383,6 +2383,10 @@ public class ApiScenarioService {
}
});
});
//以map的key为项目id 根据projectMapper查找 找不到的则移除key
List<String> projectIds = new ArrayList<>(projectEnvMap.keySet());
List<Project> projectList = baseProjectService.getProjectByIds(projectIds);
projectEnvMap.keySet().removeIf(id -> !projectList.stream().map(Project::getId).collect(Collectors.toSet()).contains(id));
return projectEnvMap;
}