fix(接口测试): 修复接口/用例 环境模块匹配错误问题。

This commit is contained in:
fit2-zhao 2021-06-15 19:03:03 +08:00 committed by fit2-zhao
parent 3d3b87949e
commit 16ac406fbd
1 changed files with 11 additions and 7 deletions

View File

@ -398,6 +398,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
/** /**
* 加载SSL认证 * 加载SSL认证
*
* @param config * @param config
* @param httpSamplerTree * @param httpSamplerTree
* @return * @return
@ -454,6 +455,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
/** /**
* 自定义请求如果是完整url时不拼接mock信息 * 自定义请求如果是完整url时不拼接mock信息
*
* @param url * @param url
* @return * @return
*/ */
@ -622,12 +624,14 @@ public class MsHTTPSamplerProxy extends MsTestElement {
break; break;
} }
} else if (item.getType().equals(ConditionType.MODULE.name())) { } else if (item.getType().equals(ConditionType.MODULE.name())) {
ApiDefinition apiDefinition; ApiDefinition apiDefinition = null;
ApiDefinitionService apiDefinitionService = CommonBeanFactory.getBean(ApiDefinitionService.class); ApiDefinitionService apiDefinitionService = CommonBeanFactory.getBean(ApiDefinitionService.class);
ApiTestCaseService apiTestCaseService = CommonBeanFactory.getBean(ApiTestCaseService.class); ApiTestCaseService apiTestCaseService = CommonBeanFactory.getBean(ApiTestCaseService.class);
if (StringUtils.isNotEmpty(this.getReferenced()) && this.getReferenced().equals("REF") && StringUtils.isNotEmpty(this.getRefType()) && this.getRefType().equals("CASE")) { if (StringUtils.isNotEmpty(this.getRefType()) && this.getRefType().equals("CASE")) {
ApiTestCaseWithBLOBs caseWithBLOBs = apiTestCaseService.get(this.getId()); ApiTestCaseWithBLOBs caseWithBLOBs = apiTestCaseService.get(this.getId());
if (caseWithBLOBs != null) {
apiDefinition = apiDefinitionService.get(caseWithBLOBs.getApiDefinitionId()); apiDefinition = apiDefinitionService.get(caseWithBLOBs.getApiDefinitionId());
}
} else { } else {
apiDefinition = apiDefinitionService.get(this.getId()); apiDefinition = apiDefinitionService.get(this.getId());
if (apiDefinition == null) { if (apiDefinition == null) {