fix(接口测试): 修复场景导入jmx时提取参数组件未给默认值的问题

--bug=1048030 --user=宋天阳 【场景导入】-使用jmx文件导入场景,请求的json提取器导入后,提取的参数类型为空 https://www.tapd.cn/55049933/s/1597746
This commit is contained in:
Jianguo-Genius 2024-10-24 18:54:03 +08:00 committed by Craftsman
parent 119ad2a37c
commit caf13cfb46
2 changed files with 2 additions and 1 deletions

View File

@ -16,7 +16,7 @@ public class JSONPostProcessorConverter extends AbstractMsElementConverter<JSONP
jsonPathExtract.setVariableName(element.getRefNames()); jsonPathExtract.setVariableName(element.getRefNames());
jsonPathExtract.setExpression(element.getJsonPathExpressions()); jsonPathExtract.setExpression(element.getJsonPathExpressions());
jsonPathExtract.setEnable(element.isEnabled()); jsonPathExtract.setEnable(element.isEnabled());
jsonPathExtract.setVariableType("TEMPORARY");
if (StringUtils.equalsIgnoreCase(element.getMatchNumbers(), "-1")) { if (StringUtils.equalsIgnoreCase(element.getMatchNumbers(), "-1")) {
jsonPathExtract.setResultMatchingRule(ResultMatchingExtract.ResultMatchingRuleType.ALL.name()); jsonPathExtract.setResultMatchingRule(ResultMatchingExtract.ResultMatchingRuleType.ALL.name());
jsonPathExtract.setResultMatchingRuleNum(-1); jsonPathExtract.setResultMatchingRuleNum(-1);

View File

@ -291,6 +291,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
environmentExample.createCriteria().andIdIn(caseEnvIds); environmentExample.createCriteria().andIdIn(caseEnvIds);
List<Environment> caseEnv = environmentMapper.selectByExample(environmentExample); List<Environment> caseEnv = environmentMapper.selectByExample(environmentExample);
Map<String, String> caseEnvMap = caseEnv.stream().collect(Collectors.toMap(Environment::getId, Environment::getName)); Map<String, String> caseEnvMap = caseEnv.stream().collect(Collectors.toMap(Environment::getId, Environment::getName));
apiCaseList.forEach(item -> { apiCaseList.forEach(item -> {
item.setProjectName(projectMap.get(item.getProjectId())); item.setProjectName(projectMap.get(item.getProjectId()));
item.setCreateUserName(userMap.get(item.getCreateUser())); item.setCreateUserName(userMap.get(item.getCreateUser()));