fix(接口测试): 修复执行完成后特殊数据导致更新环境错误

#不知道怎么复现,可以找我拿文件,凯波提供的,没issues和tapd
This commit is contained in:
fit2-zhao 2022-05-31 19:47:19 +08:00 committed by fit2-zhao
parent 60c3963976
commit 9370082e74
1 changed files with 12 additions and 2 deletions

View File

@ -128,9 +128,15 @@ public class ApiEnvironmentRunningParamService {
for (String env : envStringArr) {
if (StringUtils.contains(env, "=")) {
String[] envItem = env.split("=");
if (ArrayUtils.isEmpty(envItem)) {
continue;
}
String jmeterVarKey = envItem[0];
if (this.checkValidity(jmeterVarKey, "MS.ENV.")) {
String[] envAndKeyArr = jmeterVarKey.substring("MS.ENV.".length()).split("\\.");
if (ArrayUtils.isEmpty(envAndKeyArr)) {
continue;
}
String envId = envAndKeyArr[0];
String[] keyArr = ArrayUtils.remove(envAndKeyArr, 0);
String key = StringUtils.join(keyArr, ".");
@ -158,8 +164,12 @@ public class ApiEnvironmentRunningParamService {
}
public void parseEnvironment(List<String> evnStrList) {
for (String evnStr : evnStrList) {
this.parseEvn(evnStr);
try {
for (String evnStr : evnStrList) {
this.parseEvn(evnStr);
}
} catch (Exception e) {
LoggerUtil.error(e);
}
}