refactor(项目管理): 更新项目关联资源池默认值

This commit is contained in:
guoyuqi 2024-10-10 14:16:39 +08:00 committed by Craftsman
parent 7a9a2d74f2
commit 041df4c6e8
2 changed files with 4 additions and 0 deletions

View File

@ -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);

View File

@ -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<UserRoleRelation> 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");