From 2cc4ee0281804080f7dc81f85b13410984db6f2a Mon Sep 17 00:00:00 2001 From: lan-yonghui Date: Tue, 19 Dec 2023 14:44:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AE=9A=E4=B9=89=E6=8E=A5=E5=8F=A3=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApiDefinitionControllerTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java index 526c5af3ed..efd95be3c0 100644 --- a/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java +++ b/backend/services/api-test/src/test/java/io/metersphere/api/controller/ApiDefinitionControllerTests.java @@ -43,6 +43,7 @@ import java.nio.charset.StandardCharsets; import java.util.*; import java.util.stream.Collectors; +import static io.metersphere.api.controller.result.ApiResultCode.API_DEFINITION_MODULE_NOT_EXIST; import static io.metersphere.api.controller.result.ApiResultCode.API_DEFINITION_NOT_EXIST; import static io.metersphere.system.controller.handler.result.MsHttpResultCode.NOT_FOUND; @@ -837,6 +838,18 @@ public class ApiDefinitionControllerTests extends BaseTest { requestPostPermissionTest(PermissionConstants.PROJECT_API_DEFINITION_READ, DOC, request); } + @Test + @Order(11) + public void getDocModuleIsNull() throws Exception { + ApiDefinitionDocRequest request = new ApiDefinitionDocRequest(); + // @@模块查看文档 + request.setApiId(null); + request.setProjectId(DEFAULT_PROJECT_ID); + request.setType(ApiDefinitionDocType.MODULE.name()); + request.setModuleIds(List.of("1001001")); + assertErrorCode(this.requestPost(DOC, request), API_DEFINITION_MODULE_NOT_EXIST); + } + @Test @Order(12) public void testDel() throws Exception {