fix(接口测试): 场景详情里没有环境,可以正常执行,没提示没有环境

--user=郭雨琦
--bug=1011995
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001011995
This commit is contained in:
guoyuqi 2022-04-26 16:12:33 +08:00 committed by 刘瑞斌
parent e635eaea4e
commit aed6b493e0
1 changed files with 4 additions and 2 deletions

View File

@ -95,7 +95,8 @@ public class ApiScenarioEnvService {
http.setUrl(StringUtils.equals(testElement.getRefType(), "CASE") ? null : http.getUrl());
// 非全路径校验
if (StringUtils.isBlank(http.getUrl()) || (http.getIsRefEnvironment() != null && http.getIsRefEnvironment())) {
if (!StringUtils.equalsIgnoreCase(http.getReferenced(), "Created") || (http.getIsRefEnvironment() != null &&
http.getIsRefEnvironment())) {
env.getProjectIds().add(http.getProjectId());
env.setFullUrl(false);
}
@ -132,7 +133,8 @@ public class ApiScenarioEnvService {
if (StringUtils.equals(testElement.getType(), "HTTPSamplerProxy")) {
// 校验是否是全路径
MsHTTPSamplerProxy httpSamplerProxy = (MsHTTPSamplerProxy) testElement;
if (StringUtils.isBlank(httpSamplerProxy.getUrl()) || (httpSamplerProxy.getIsRefEnvironment() != null && httpSamplerProxy.getIsRefEnvironment())) {
if (!StringUtils.equalsIgnoreCase(httpSamplerProxy.getReferenced(), "Created") || (httpSamplerProxy.getIsRefEnvironment() != null &&
httpSamplerProxy.getIsRefEnvironment())) {
env.getProjectIds().add(httpSamplerProxy.getProjectId());
env.setFullUrl(false);
}