fix(接口测试): 兼容导入数据没有环境资源池无法执行问题
--bug=1021399 --user=赵勇 【接口测试】有一个场景,使用LOCAL资源池执行一直pending https://www.tapd.cn/55049933/s/1321056
This commit is contained in:
parent
3d80530beb
commit
e54f206eee
|
@ -94,10 +94,11 @@ public class GenerateHashTreeUtil {
|
|||
String environmentType = apiScenarioWithBLOBs.getEnvironmentType();
|
||||
String environmentJson = apiScenarioWithBLOBs.getEnvironmentJson();
|
||||
String environmentGroupId = apiScenarioWithBLOBs.getEnvironmentGroupId();
|
||||
|
||||
if (StringUtils.isBlank(environmentType)) {
|
||||
environmentType = EnvironmentType.JSON.toString();
|
||||
}
|
||||
if (StringUtils.equals(environmentType, EnvironmentType.JSON.toString())) {
|
||||
if (StringUtils.equals(environmentType, EnvironmentType.JSON.toString()) && StringUtils.isNotBlank(environmentJson)) {
|
||||
scenario.setEnvironmentMap(JSON.parseObject(environmentJson, Map.class));
|
||||
} else if (StringUtils.equals(environmentType, EnvironmentType.GROUP.toString())) {
|
||||
Map<String, String> map = CommonBeanFactory.getBean(BaseEnvGroupProjectService.class).getEnvMap(environmentGroupId);
|
||||
|
@ -133,7 +134,7 @@ public class GenerateHashTreeUtil {
|
|||
String definition = element.toString();
|
||||
MsScenario scenario = JSON.parseObject(definition, MsScenario.class);
|
||||
group.setOnSampleError(scenario.getOnSampleError());
|
||||
if (planEnvMap != null && planEnvMap.size() > 0) {
|
||||
if (MapUtils.isNotEmpty(planEnvMap)) {
|
||||
scenario.setEnvironmentMap(planEnvMap);
|
||||
} else {
|
||||
setScenarioEnv(scenario, item);
|
||||
|
|
Loading…
Reference in New Issue