diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/mock/RequestMockParams.java b/api-test/backend/src/main/java/io/metersphere/api/dto/mock/RequestMockParams.java index 972da0d5a0..3551c818e2 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/mock/RequestMockParams.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/mock/RequestMockParams.java @@ -3,6 +3,7 @@ package io.metersphere.api.dto.mock; import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; import org.json.JSONObject; /** @@ -29,12 +30,21 @@ public class RequestMockParams { public boolean isEmpty() { + boolean isJsonParamEmpty = false; + if (jsonParam instanceof JSONObject) { + isJsonParamEmpty = ((JSONObject) jsonParam).isEmpty(); + } else if (jsonParam instanceof JSONArray) { + isJsonParamEmpty = ((JSONArray) jsonParam).isEmpty(); + } else { + isJsonParamEmpty = jsonParam == null; + } if (isPost) { return (restParamsObj == null || restParamsObj.isEmpty()) && + isJsonParamEmpty && (queryParamsObj == null || queryParamsObj.isEmpty()) && StringUtils.isBlank(raw); } else { - return (restParamsObj == null || restParamsObj.isEmpty()) && + return (restParamsObj == null || restParamsObj.isEmpty()) && isJsonParamEmpty && (queryParamsObj == null || queryParamsObj.isEmpty()); } diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResult.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResult.vue index f0ab939e71..6f42b017a8 100644 --- a/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResult.vue +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/ui/RequestResult.vue @@ -45,13 +45,20 @@ :open-delay="800" >
{{ baseErrorCode }}
{{ baseErrorCode }} @@ -97,13 +104,20 @@ :open-delay="800" >
{{ request.responseResult.responseCode }}
{{ request.responseResult.responseCode }} @@ -145,13 +159,20 @@
{{ request.responseResult.responseTime }}
{{ request.responseResult.responseTime }}