fix(接口测试): 场景只引用tcp接口,不选环境就能调试

--bug=1010027 --user=lyh 【接口测试】场景只引用tcp接口,不选环境就能调试
https://www.tapd.cn/55049933/s/1099906
This commit is contained in:
shiziyuan9527 2022-01-27 14:36:08 +08:00 committed by shiziyuan9527
parent e5fd6edfa4
commit c79c49fd8f
1 changed files with 6 additions and 0 deletions

View File

@ -88,11 +88,13 @@ public class ApiScenarioEnvService {
ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = apiTestCaseService.get(tr.getId());
if (apiTestCaseWithBLOBs != null) {
env.getProjectIds().add(apiTestCaseWithBLOBs.getProjectId());
env.setFullUrl(false);
}
} else {
ApiDefinition apiDefinition = apiDefinitionService.get(tr.getId());
if (apiDefinition != null) {
env.getProjectIds().add(apiDefinition.getProjectId());
env.setFullUrl(false);
}
}
} else if (StringUtils.equals(tr.getType(), "scenario")) {
@ -117,6 +119,7 @@ public class ApiScenarioEnvService {
}
} else if (StringUtils.equals(tr.getType(), "JDBCSampler") || StringUtils.equals(tr.getType(), "TCPSampler")) {
env.getProjectIds().add(tr.getProjectId());
env.setFullUrl(false);
}
}
if (StringUtils.equals(tr.getType(), "scenario")) {
@ -163,9 +166,11 @@ public class ApiScenarioEnvService {
if (StringUtils.equals(tr.getRefType(), "CASE")) {
ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = apiTestCaseService.get(tr.getId());
env.getProjectIds().add(apiTestCaseWithBLOBs.getProjectId());
env.setFullUrl(false);
} else {
ApiDefinition apiDefinition = apiDefinitionService.get(tr.getId());
env.getProjectIds().add(apiDefinition.getProjectId());
env.setFullUrl(false);
}
} else if (StringUtils.equals(tr.getType(), "scenario")) {
if (tr.isEnable()) {
@ -193,6 +198,7 @@ public class ApiScenarioEnvService {
}
} else if (StringUtils.equals(tr.getType(), "JDBCSampler") || StringUtils.equals(tr.getType(), "TCPSampler")) {
env.getProjectIds().add(tr.getProjectId());
env.setFullUrl(false);
}
}
if (StringUtils.equals(tr.getType(), "scenario")) {