fix(接口测试): 修复场景转性能测试时由于json格式问题引起的报错

--bug=1013687 --user=宋天阳 [性能测试]Github #14092通过自动化场景创建性能测试失败
https://www.tapd.cn/55049933/s/1169745
This commit is contained in:
song-tianyang 2022-05-31 14:17:52 +08:00 committed by f2c-ci-robot[bot]
parent d3d3d1b21b
commit 3fbe57f0cf
1 changed files with 2 additions and 3 deletions

View File

@ -813,8 +813,7 @@ public class ApiAutomationService {
config.setOperating(true);
config.getExcludeScenarioIds().add(apiScenario.getId());
try {
MsScenario scenario = JSONObject.parseObject(apiScenario.getScenarioDefinition(), MsScenario.class);
MsScenario scenario = JSONObject.parseObject(apiScenario.getScenarioDefinition(), MsScenario.class,Feature.DisableSpecialKeyDetect);
if (scenario == null) {
return null;
}
@ -824,7 +823,7 @@ public class ApiAutomationService {
String environmentJson = apiScenario.getEnvironmentJson();
String environmentGroupId = apiScenario.getEnvironmentGroupId();
if (StringUtils.equals(environmentType, EnvironmentType.JSON.name()) && StringUtils.isNotBlank(environmentJson)) {
scenario.setEnvironmentMap(JSON.parseObject(environmentJson, Map.class));
scenario.setEnvironmentMap(JSON.parseObject(environmentJson, Map.class,Feature.DisableSpecialKeyDetect));
} else if (StringUtils.equals(environmentType, EnvironmentType.GROUP.name()) && StringUtils.isNotBlank(environmentGroupId)) {
Map<String, String> envMap = environmentGroupProjectService.getEnvMap(environmentGroupId);
scenario.setEnvironmentMap(envMap);