refactor(接口测试): 解决导入文件有缺失时系统报错问题

--user=郭雨琦
--bug=1015165
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001015165
This commit is contained in:
guoyuqi 2022-07-22 17:37:28 +08:00 committed by xiaomeinvG
parent b756ceb6bb
commit f9b4f67586
1 changed files with 10 additions and 0 deletions

View File

@ -1224,6 +1224,16 @@ public class ApiDefinitionService {
JsonNode exApiResponse = null;
JsonNode apiResponse = null;
if (StringUtils.isBlank(apiDefinition.getResponse()) && StringUtils.isBlank(existApi.getResponse())) {
return false;
}
if (StringUtils.isBlank(apiDefinition.getResponse()) && StringUtils.isNotBlank(existApi.getResponse())) {
return false;
}
if (StringUtils.isNotBlank(apiDefinition.getResponse()) && StringUtils.isBlank(existApi.getResponse())) {
return false;
}
try {
exApiResponse = objectMapper.readTree(existApi.getResponse());
apiResponse = objectMapper.readTree(apiDefinition.getResponse());