From 041df4c6e8582b7285abb078bb95695f053e8ce2 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Thu, 10 Oct 2024 14:16:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE=E5=85=B3=E8=81=94?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=B1=A0=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/system/service/CommonProjectService.java | 1 + .../system/controller/OrganizationProjectControllerTests.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/CommonProjectService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/CommonProjectService.java index ac1d0a2b4d..ac0ac92588 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/CommonProjectService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/CommonProjectService.java @@ -283,6 +283,7 @@ public class CommonProjectService { project.setDescription(updateProjectDto.getDescription()); project.setOrganizationId(updateProjectDto.getOrganizationId()); project.setEnable(updateProjectDto.getEnable()); + project.setAllResourcePool(updateProjectDto.isAllResourcePool()); project.setUpdateUser(updateUser); project.setCreateUser(null); project.setCreateTime(null); diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationProjectControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationProjectControllerTests.java index 20aaac0d27..d3dcf071cd 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationProjectControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationProjectControllerTests.java @@ -605,6 +605,7 @@ public class OrganizationProjectControllerTests extends BaseTest { ProjectDTO result = parseObjectFromMvcResult(mvcResult, ProjectDTO.class); Project currentProject = projectMapper.selectByPrimaryKey(project.getId()); compareProjectDTO(currentProject, result); + Assertions.assertFalse(currentProject.getAllResourcePool()); UserRoleRelationExample userRoleRelationExample = new UserRoleRelationExample(); userRoleRelationExample.createCriteria().andSourceIdEqualTo(projectId).andRoleIdEqualTo(InternalUserRole.PROJECT_ADMIN.getValue()); List userRoleRelations = userRoleRelationMapper.selectByExample(userRoleRelationExample); @@ -634,9 +635,11 @@ public class OrganizationProjectControllerTests extends BaseTest { moduleIds.add("apiTest"); moduleIds.add("uiTest"); project.setModuleIds(moduleIds); + project.setAllResourcePool(true); mvcResult = this.responsePost(updateProject, project); result = parseObjectFromMvcResult(mvcResult, ProjectDTO.class); currentProject = projectMapper.selectByPrimaryKey(project.getId()); + Assertions.assertTrue(currentProject.getAllResourcePool()); compareProjectDTO(currentProject, result); //断言模块设置 projectExtend = projectMapper.selectByPrimaryKey("projectId2");