fix(接口测试): 修复导入jmx自定义请求环境校验错误问题

--bug=1013259 --user=赵勇 接口测试-接口自动化导入jmx文件,导入生成的自定义请求中已包含域名,在场景调试时无需选择环境 https://www.tapd.cn/55049933/s/1160003
This commit is contained in:
fit2-zhao 2022-05-18 19:08:29 +08:00 committed by f2c-ci-robot[bot]
parent 419c876f4f
commit e29ab5d736
1 changed files with 6 additions and 2 deletions

View File

@ -133,11 +133,15 @@ public class ApiScenarioEnvService {
if (StringUtils.equals(testElement.getType(), "HTTPSamplerProxy")) {
// 校验是否是全路径
MsHTTPSamplerProxy httpSamplerProxy = (MsHTTPSamplerProxy) testElement;
if (!StringUtils.equalsIgnoreCase(httpSamplerProxy.getReferenced(), "Created") || (httpSamplerProxy.getIsRefEnvironment() != null &&
if (httpSamplerProxy.isCustomizeReq()) {
env.getProjectIds().add(httpSamplerProxy.getProjectId());
env.setFullUrl(httpSamplerProxy.getIsRefEnvironment() == null ? true : httpSamplerProxy.getIsRefEnvironment());
} else if (!StringUtils.equalsIgnoreCase(httpSamplerProxy.getReferenced(), "Created") || (httpSamplerProxy.getIsRefEnvironment() != null &&
httpSamplerProxy.getIsRefEnvironment())) {
env.getProjectIds().add(httpSamplerProxy.getProjectId());
env.setFullUrl(httpSamplerProxy.getIsRefEnvironment() == null ? true : false);
env.setFullUrl(false);
}
} else if (StringUtils.equals(testElement.getType(), "JDBCSampler") || StringUtils.equals(testElement.getType(), "TCPSampler")) {
env.getProjectIds().add(testElement.getProjectId());
env.setFullUrl(false);