diff --git a/api-test/backend/src/main/java/io/metersphere/commons/utils/ErrorReportLibraryUtil.java b/api-test/backend/src/main/java/io/metersphere/commons/utils/ErrorReportLibraryUtil.java index 7a0a20f1cb..416cfb6a46 100644 --- a/api-test/backend/src/main/java/io/metersphere/commons/utils/ErrorReportLibraryUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/commons/utils/ErrorReportLibraryUtil.java @@ -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 ((higherThanError && !resultIsSuccess) || (higherThanSuccess && resultIsSuccess)) { 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; } diff --git a/api-test/backend/src/main/java/io/metersphere/commons/utils/ResponseUtil.java b/api-test/backend/src/main/java/io/metersphere/commons/utils/ResponseUtil.java index 85d55e65d2..c25f29fd9b 100644 --- a/api-test/backend/src/main/java/io/metersphere/commons/utils/ResponseUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/commons/utils/ResponseUtil.java @@ -35,10 +35,14 @@ public class ResponseUtil { expandMap.put("status", ApiReportStatus.FAKE_ERROR.name()); } 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())) { 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; }