refactor(场景自动化): 优化执行场景前环境检查

This commit is contained in:
shiziyuan9527 2021-04-28 16:00:48 +08:00 committed by 刘瑞斌
parent 37e99b3eee
commit ca4900b6a0
1 changed files with 10 additions and 1 deletions

View File

@ -917,6 +917,12 @@ public class ApiAutomationService {
if (StringUtils.isBlank(s)) {
isEnv = false;
break;
} else {
ApiTestEnvironmentWithBLOBs env = apiTestEnvironmentMapper.selectByPrimaryKey(s);
if (env == null) {
isEnv = false;
break;
}
}
}
} else {
@ -933,7 +939,10 @@ public class ApiAutomationService {
if (!isEnv) {
String envId = scenario.getEnvironmentId();
if (StringUtils.isNotBlank(envId)) {
isEnv = true;
ApiTestEnvironmentWithBLOBs env = apiTestEnvironmentMapper.selectByPrimaryKey(envId);
if (env != null) {
isEnv = true;
}
}
}
return isEnv;