From 8b5c5d1af6c6b283448ce230e03463926110e23e Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Fri, 25 Aug 2023 15:52:21 +0800 Subject: [PATCH] =?UTF-8?q?test(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E7=BB=84=E7=BB=87=E6=88=90=E5=91=98=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/system/mapper/ExtUserRoleMapper.xml | 7 ++++--- .../controller/OrganizationUserRoleControllerTests.java | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleMapper.xml b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleMapper.xml index 313deca153..735f9a9699 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleMapper.xml +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/mapper/ExtUserRoleMapper.xml @@ -15,10 +15,11 @@ \ No newline at end of file diff --git a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationUserRoleControllerTests.java b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationUserRoleControllerTests.java index dac46114e4..1eba071cef 100644 --- a/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationUserRoleControllerTests.java +++ b/backend/services/system-setting/src/test/java/io/metersphere/system/controller/OrganizationUserRoleControllerTests.java @@ -51,7 +51,6 @@ public class OrganizationUserRoleControllerTests extends BaseTest { @Resource private OrganizationService organizationService; - public static final String ORGANIZATION_ROLE_TYPE = "ORGANIZATION"; public static final String ORGANIZATION_USER_ROLE_LIST = "/user/role/organization/list"; public static final String ORGANIZATION_USER_ROLE_ADD = "/user/role/organization/add"; public static final String ORGANIZATION_USER_ROLE_UPDATE = "/user/role/organization/update"; @@ -243,7 +242,7 @@ public class OrganizationUserRoleControllerTests extends BaseTest { OrganizationUserRoleMemberRequest request = new OrganizationUserRoleMemberRequest(); request.setOrganizationId("default-organization-2"); request.setUserRoleId("default-org-role-id-3"); - request.setKeyword("admin"); + request.setUserKeyWord("admin"); request.setCurrent(1); request.setPageSize(10); MvcResult mvcResult = this.responsePost(ORGANIZATION_USER_ROLE_LIST_MEMBER, request); @@ -259,12 +258,12 @@ public class OrganizationUserRoleControllerTests extends BaseTest { Assertions.assertEquals(pageData.getCurrent(), request.getCurrent()); // 返回的数据量不超过规定要返回的数据量相同 Assertions.assertTrue(JSON.parseArray(JSON.toJSONString(pageData.getList())).size() <= request.getPageSize()); - // 返回值中取出第一条数据, 并判断是否包含关键字default + // 返回值中取出第一条数据, 并判断是否包含关键字 List userList = JSON.parseArray(JSON.toJSONString(pageData.getList()), User.class); if(CollectionUtils.isNotEmpty(userList)) { User user = userList.get(0); - Assertions.assertTrue(StringUtils.contains(user.getName(), request.getKeyword()) - || StringUtils.contains(user.getId(), request.getKeyword())); + Assertions.assertTrue(StringUtils.contains(user.getName(), request.getUserKeyWord()) + || StringUtils.contains(user.getId(), request.getUserKeyWord())); } // 权限校验 request.setOrganizationId(getDefault().getId());