fix(测试跟踪): 修复测试计划报告导出后接口用例响应体不展示的问题
--bug=1021945 --user=宋天阳 【测试跟踪】导出测试计划报告-接口用例-响应体不显示 https://www.tapd.cn/55049933/s/1327149
This commit is contained in:
parent
c395b120ce
commit
4afdc28053
|
@ -439,11 +439,16 @@ public class TestPlanApiCaseService {
|
|||
try {
|
||||
responseObj = JSON.parseMap(execResult.getContent());
|
||||
} catch (Exception e) {
|
||||
LogUtil.error("转换content失败!", e);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(execResult.getEnvConfig())) {
|
||||
responseObj.put("envName", apiDefinitionService.getEnvNameByEnvConfig(execResult.getProjectId(), execResult.getEnvConfig()));
|
||||
}
|
||||
item.setResponse(responseObj.toString());
|
||||
/*
|
||||
* 之前这里的写法是responseObj.toString()。
|
||||
* 猜测是fastjson转换之后,只是单纯的把JSONObject改成了map。所以这里放进去的不是json格式的数据
|
||||
*/
|
||||
item.setResponse(JSON.toJSONString(responseObj));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue