fix(接口测试): 误报解析方法增加相关日志

误报解析方法增加相关日志
This commit is contained in:
song-tianyang 2022-11-24 13:59:50 +08:00 committed by 建国
parent 64eccbf210
commit 3dbb520ad6
2 changed files with 10 additions and 1 deletions

View File

@ -143,13 +143,18 @@ public class ErrorReportLibraryUtil {
} }
}); });
} }
LogUtil.info(" FAKE_ERROR result: config-higherThanError:" + higherThanError + ", config-higherThanSuccess:" + higherThanSuccess + ", resultIsSuccess: " + resultIsSuccess);
if (CollectionUtils.isNotEmpty(result.errorCodeList)) { if (CollectionUtils.isNotEmpty(result.errorCodeList)) {
if ((higherThanError && !resultIsSuccess) || (higherThanSuccess && resultIsSuccess)) { if ((higherThanError && !resultIsSuccess) || (higherThanSuccess && resultIsSuccess)) {
result.requestStatus = ApiReportStatus.FAKE_ERROR.name(); result.requestStatus = ApiReportStatus.FAKE_ERROR.name();
} }
} }
} }
LogUtil.info(" FAKE_ERROR result: config-higherThanError:" + higherThanError
+ ", config-higherThanSuccess:" + higherThanSuccess
+ ", resultIsSuccess: " + resultIsSuccess
+ ", isFakeError: " + ((higherThanError && !resultIsSuccess) || (higherThanSuccess && resultIsSuccess))
+ "; status:" + result.requestStatus);
return result; return result;
} }

View File

@ -35,10 +35,14 @@ public class ResponseUtil {
expandMap.put("status", ApiReportStatus.FAKE_ERROR.name()); expandMap.put("status", ApiReportStatus.FAKE_ERROR.name());
} }
expandDTO.setAttachInfoMap(expandMap); expandDTO.setAttachInfoMap(expandMap);
LogUtil.info(" FAKE_ERROR result.id:" + errorCodeDTO.getRequestStatus() + "; AttachInfoMap:" + JSON.toJSONString(expandDTO.getAttachInfoMap()));
} }
if (StringUtils.equalsIgnoreCase(errorCodeDTO.getRequestStatus(), ApiReportStatus.FAKE_ERROR.name())) { if (StringUtils.equalsIgnoreCase(errorCodeDTO.getRequestStatus(), ApiReportStatus.FAKE_ERROR.name())) {
expandDTO.setStatus(errorCodeDTO.getRequestStatus()); expandDTO.setStatus(errorCodeDTO.getRequestStatus());
} }
LogUtil.info(" FAKE_ERROR result.id:" + errorCodeDTO.getRequestStatus()
+ ";status:" + expandDTO.getStatus()
+ " AttachInfoMap:" + (expandDTO.getAttachInfoMap() == null ? "null" : JSON.toJSONString(expandDTO.getAttachInfoMap())));
return expandDTO; return expandDTO;
} }