feat: add org member

This commit is contained in:
guoyuqi 2023-07-21 19:24:19 +08:00 committed by 刘瑞斌
parent f99b48b824
commit bf38341b64
2 changed files with 8 additions and 2 deletions

View File

@ -123,8 +123,10 @@ public class OrganizationControllerTests extends BaseTest {
//组织ID正确
// 成员选择为空
addOrUpdateOrganizationMemberError(ORGANIZATION_UPDATE_MEMBER, "sys_default_organization_3", Collections.emptyList(), Arrays.asList("default-org-role-id-2", "default-org-role-id-3"), status().isBadRequest());
// 成员不存在
// 成员不存在
addOrUpdateOrganizationMemberError(ORGANIZATION_UPDATE_MEMBER, "sys_default_organization_3", Arrays.asList("sys_default_user3", "sys_default_user4"), Arrays.asList("default-org-role-id-2", "default-org-role-id-3"), status().is5xxServerError());
// 成员有一个不存在
addOrUpdateOrganizationMemberError(ORGANIZATION_UPDATE_MEMBER, "sys_default_organization_3", Arrays.asList("sys_default_user", "sys_default_user4"), Arrays.asList("default-org-role-id-2", "default-org-role-id-3"), status().is5xxServerError());
// 用户组不存在
addOrUpdateOrganizationMemberError(ORGANIZATION_UPDATE_MEMBER, "sys_default_organization_3", Arrays.asList("sys_default_user", "sys_default_user2"), Collections.emptyList(), status().isBadRequest());
//成员和用户组都为空
@ -162,8 +164,10 @@ public class OrganizationControllerTests extends BaseTest {
//组织ID正确
// 成员选择为空
addOrUpdateOrganizationMemberError(ORGANIZATION_UPDATE_MEMBER_TO_ROLE, "sys_default_organization_3", Collections.emptyList(), Arrays.asList("default-org-role-id-2", "default-org-role-id-3"), status().isBadRequest());
// 成员不存在
// 成员不存在
addOrUpdateOrganizationMemberError(ORGANIZATION_UPDATE_MEMBER_TO_ROLE, "sys_default_organization_3", Arrays.asList("sys_default_user3", "sys_default_user4"), Arrays.asList("default-org-role-id-2", "default-org-role-id-3"), status().is5xxServerError());
// 成员有一个不存在
addOrUpdateOrganizationMemberError(ORGANIZATION_UPDATE_MEMBER_TO_ROLE, "sys_default_organization_3", Arrays.asList("sys_default_user", "sys_default_user4"), Arrays.asList("default-org-role-id-2", "default-org-role-id-3"), status().is5xxServerError());
// 用户组不存在
addOrUpdateOrganizationMemberError(ORGANIZATION_UPDATE_MEMBER_TO_ROLE, "sys_default_organization_3", Arrays.asList("sys_default_user", "sys_default_user2"), Collections.emptyList(), status().isBadRequest());
//成员和用户组都为空

View File

@ -265,6 +265,8 @@ public class SystemOrganizationControllerTests extends BaseTest{
public void testRemoveOrganizationMemberError() throws Exception {
// 组织不存在
this.requestGet(ORGANIZATION_REMOVE_MEMBER + "/default-organization-x/admin-x", status().is5xxServerError());
// 用户不存在
this.requestGet(ORGANIZATION_REMOVE_MEMBER + "/default-organization-3/admin-x", status().is5xxServerError());
}
@Test