fix(接口测试): 修复测试计划执行本身无环境且关联时也不指定环境的场景会报错的问题

--bug=1032337 --user=宋天阳 【测试跟踪】测试计划-关联场景用例后执行失败,后台日志提示500
https://www.tapd.cn/55049933/s/1430002
This commit is contained in:
song-tianyang 2023-10-24 16:29:54 +08:00 committed by 刘瑞斌
parent 6817125b6b
commit 5e9b1b3313
1 changed files with 2 additions and 2 deletions

View File

@ -861,9 +861,9 @@ public class ApiScenarioReportService {
private Map<String, String> extractScenarioEnv(String envType, String envJson, String envGroupId) {
Map<String, String> scenarioEnv = new LinkedHashMap<>();
if (envType.equals(EnvironmentType.JSON.name()) && StringUtils.isNotBlank(envJson)) {
if (StringUtils.equals(envType, EnvironmentType.JSON.name()) && StringUtils.isNotBlank(envJson)) {
scenarioEnv = JSON.parseObject(envJson, Map.class);
} else if (envType.equals(EnvironmentType.GROUP.name()) && StringUtils.isNotBlank(envGroupId)) {
} else if (StringUtils.equals(envType, EnvironmentType.GROUP.name()) && StringUtils.isNotBlank(envGroupId)) {
scenarioEnv = environmentGroupProjectService.getEnvMap(envGroupId);
}
return scenarioEnv;