1. 中铝e办组织机构人员同步联调接口
2. 设置默认文件预览水印为人员加日期
This commit is contained in:
@@ -0,0 +1,209 @@
|
||||
package cn.iocoder.yudao.module.system.service.sync;
|
||||
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.sync.vo.org.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
public class OrgSyncServiceImplTest extends BaseMockitoUnitTest {
|
||||
|
||||
@InjectMocks
|
||||
private OrgSyncServiceImpl orgSyncService;
|
||||
|
||||
@Mock
|
||||
private DeptService deptService;
|
||||
|
||||
@Test
|
||||
void testCreateOrg() {
|
||||
// Arrange
|
||||
OrgCreateRequestVO requestVO = randomPojo(OrgCreateRequestVO.class);
|
||||
Long newDeptId = randomLongId();
|
||||
when(deptService.createDept(any(DeptSaveReqVO.class))).thenReturn(newDeptId);
|
||||
|
||||
// Act
|
||||
OrgCreateResponseVO response = orgSyncService.createOrg(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals(requestVO.getBimRequestId(), response.getBimRequestId());
|
||||
assertEquals(String.valueOf(newDeptId), response.getUid());
|
||||
|
||||
ArgumentCaptor<DeptSaveReqVO> captor = ArgumentCaptor.forClass(DeptSaveReqVO.class);
|
||||
verify(deptService).createDept(captor.capture());
|
||||
DeptSaveReqVO capturedVO = captor.getValue();
|
||||
assertEquals(requestVO.getName(), capturedVO.getName());
|
||||
assertEquals(requestVO.getParentId(), capturedVO.getParentId());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDeleteOrg() {
|
||||
// Arrange
|
||||
OrgDeleteRequestVO requestVO = new OrgDeleteRequestVO();
|
||||
requestVO.setBimOrgId(123L);
|
||||
requestVO.setBimRequestId("req-456");
|
||||
|
||||
// Act
|
||||
OrgDeleteResponseVO response = orgSyncService.deleteOrg(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
assertEquals(requestVO.getBimRequestId(), response.getBimRequestId());
|
||||
verify(deptService).deleteDept(123L);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUpdateOrg_Success() {
|
||||
// Arrange
|
||||
OrgUpdateRequestVO requestVO = randomPojo(OrgUpdateRequestVO.class);
|
||||
requestVO.setBimOrgId(randomLongId());
|
||||
|
||||
DeptDO existingDept = randomPojo(DeptDO.class);
|
||||
existingDept.setStatus(0); // Active
|
||||
when(deptService.getDept(requestVO.getBimOrgId())).thenReturn(existingDept);
|
||||
|
||||
// Act
|
||||
OrgUpdateResponseVO response = orgSyncService.updateOrg(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
assertTrue(response.get__ENABLE__());
|
||||
|
||||
ArgumentCaptor<DeptSaveReqVO> captor = ArgumentCaptor.forClass(DeptSaveReqVO.class);
|
||||
verify(deptService).updateDept(captor.capture());
|
||||
DeptSaveReqVO capturedVO = captor.getValue();
|
||||
assertEquals(requestVO.getBimOrgId(), capturedVO.getId());
|
||||
assertEquals(requestVO.getName(), capturedVO.getName());
|
||||
assertEquals(requestVO.getParentId(), capturedVO.getParentId());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUpdateOrg_NotFound() {
|
||||
// Arrange
|
||||
OrgUpdateRequestVO requestVO = randomPojo(OrgUpdateRequestVO.class);
|
||||
requestVO.setBimOrgId(randomLongId());
|
||||
when(deptService.getDept(requestVO.getBimOrgId())).thenReturn(null);
|
||||
|
||||
// Act
|
||||
OrgUpdateResponseVO response = orgSyncService.updateOrg(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("500", response.getResultCode());
|
||||
assertEquals("机构不存在或当前账号无权限修改", response.getMessage());
|
||||
assertFalse(response.get__ENABLE__());
|
||||
verify(deptService, never()).updateDept(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetOrgById_Success() {
|
||||
// Arrange
|
||||
OrgGetRequestVO requestVO = new OrgGetRequestVO();
|
||||
Long deptId = randomLongId();
|
||||
requestVO.setBimOrgId(String.valueOf(deptId));
|
||||
requestVO.setBimRequestId("req-789");
|
||||
|
||||
DeptDO dept = randomPojo(DeptDO.class);
|
||||
dept.setId(deptId);
|
||||
when(deptService.getDept(deptId)).thenReturn(dept);
|
||||
|
||||
// Act
|
||||
OrgGetResponseVO response = orgSyncService.getOrgById(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
assertNotNull(response.getOrganization());
|
||||
assertEquals(dept.getId(), response.getOrganization().get("uid"));
|
||||
assertEquals(dept.getName(), response.getOrganization().get("name"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetOrgById_NotFound() {
|
||||
// Arrange
|
||||
OrgGetRequestVO requestVO = new OrgGetRequestVO();
|
||||
Long deptId = randomLongId();
|
||||
requestVO.setBimOrgId(String.valueOf(deptId));
|
||||
when(deptService.getDept(deptId)).thenReturn(null);
|
||||
|
||||
// Act
|
||||
OrgGetResponseVO response = orgSyncService.getOrgById(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("500", response.getResultCode());
|
||||
assertEquals("机构不存在或当前账号无权限修改", response.getMessage());
|
||||
assertNull(response.getOrganization());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetOrgById_InvalidId() {
|
||||
// Arrange
|
||||
OrgGetRequestVO requestVO = new OrgGetRequestVO();
|
||||
requestVO.setBimOrgId("invalid-id");
|
||||
|
||||
// Act
|
||||
OrgGetResponseVO response = orgSyncService.getOrgById(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("500", response.getResultCode());
|
||||
assertEquals("参数错误", response.getMessage());
|
||||
assertNull(response.getOrganization());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testListOrgIds() {
|
||||
// Arrange
|
||||
OrgListRequestVO requestVO = randomPojo(OrgListRequestVO.class);
|
||||
DeptDO dept1 = randomPojo(DeptDO.class);
|
||||
DeptDO dept2 = randomPojo(DeptDO.class);
|
||||
List<DeptDO> deptList = List.of(dept1, dept2);
|
||||
when(deptService.getDeptList(any(DeptListReqVO.class))).thenReturn(deptList);
|
||||
|
||||
// Act
|
||||
OrgListResponseVO response = orgSyncService.listOrgIds(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
assertEquals(2, response.getOrgIdList().size());
|
||||
assertTrue(response.getOrgIdList().contains(String.valueOf(dept1.getId())));
|
||||
assertTrue(response.getOrgIdList().contains(String.valueOf(dept2.getId())));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testListOrgIds_Empty() {
|
||||
// Arrange
|
||||
OrgListRequestVO requestVO = randomPojo(OrgListRequestVO.class);
|
||||
when(deptService.getDeptList(any(DeptListReqVO.class))).thenReturn(Collections.emptyList());
|
||||
|
||||
// Act
|
||||
OrgListResponseVO response = orgSyncService.listOrgIds(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
assertTrue(response.getOrgIdList().isEmpty());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.system.service.sync;
|
||||
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.sync.vo.schema.SchemaAttributeVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.sync.vo.schema.SchemaRequestVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.sync.vo.schema.SchemaResponseVO;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.InjectMocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class SchemaSyncServiceImplTest extends BaseMockitoUnitTest {
|
||||
|
||||
@InjectMocks
|
||||
private SchemaSyncServiceImpl schemaSyncService;
|
||||
|
||||
@Test
|
||||
void testGetSchema() {
|
||||
// Arrange
|
||||
SchemaRequestVO requestVO = randomPojo(SchemaRequestVO.class);
|
||||
|
||||
// Act
|
||||
SchemaResponseVO response = schemaSyncService.getSchema(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals(requestVO.getBimRequestId(), response.getBimRequestId());
|
||||
|
||||
// Validate Account Schema
|
||||
List<SchemaAttributeVO> accountSchema = response.getAccount();
|
||||
assertNotNull(accountSchema);
|
||||
assertFalse(accountSchema.isEmpty());
|
||||
// Check for a few expected fields in AdminUserDO
|
||||
assertTrue(accountSchema.stream().anyMatch(a -> "username".equals(a.getName()) && "String".equals(a.getType())));
|
||||
assertTrue(accountSchema.stream().anyMatch(a -> "nickname".equals(a.getName()) && "String".equals(a.getType())));
|
||||
assertTrue(accountSchema.stream().anyMatch(a -> "deptIds".equals(a.getName()) && "Set".equals(a.getType()) && a.getMultivalued()));
|
||||
// Check that excluded fields are not present
|
||||
assertTrue(accountSchema.stream().noneMatch(a -> "tenantId".equals(a.getName())));
|
||||
assertTrue(accountSchema.stream().noneMatch(a -> "avatar".equals(a.getName())));
|
||||
|
||||
|
||||
// Validate Organization Schema
|
||||
List<SchemaAttributeVO> orgSchema = response.getOrganization();
|
||||
assertNotNull(orgSchema);
|
||||
assertFalse(orgSchema.isEmpty());
|
||||
// Check for a few expected fields in DeptDO
|
||||
assertTrue(orgSchema.stream().anyMatch(a -> "name".equals(a.getName()) && "String".equals(a.getType())));
|
||||
assertTrue(orgSchema.stream().anyMatch(a -> "parentId".equals(a.getName()) && "Long".equals(a.getType())));
|
||||
assertTrue(orgSchema.stream().anyMatch(a -> "leaderUserId".equals(a.getName()) && "Long".equals(a.getType())));
|
||||
// Check that excluded fields are not present
|
||||
assertTrue(orgSchema.stream().noneMatch(a -> "creator".equals(a.getName())));
|
||||
assertTrue(orgSchema.stream().noneMatch(a -> "updateTime".equals(a.getName())));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
package cn.iocoder.yudao.module.system.service.sync;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.sync.vo.user.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import cn.iocoder.yudao.module.system.service.userdept.UserDeptService;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockedStatic;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
public class UserSyncServiceImplTest extends BaseMockitoUnitTest {
|
||||
|
||||
@InjectMocks
|
||||
private UserSyncServiceImpl userSyncService;
|
||||
|
||||
@Mock
|
||||
private AdminUserService adminUserService;
|
||||
|
||||
@Mock
|
||||
private UserDeptService userDeptService;
|
||||
|
||||
private MockedStatic<SecurityFrameworkUtils> securityFrameworkUtilsMock;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
securityFrameworkUtilsMock = Mockito.mockStatic(SecurityFrameworkUtils.class);
|
||||
LoginUser mockLoginUser = new LoginUser();
|
||||
mockLoginUser.setTenantId(1L);
|
||||
securityFrameworkUtilsMock.when(SecurityFrameworkUtils::getLoginUser).thenReturn(mockLoginUser);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void tearDown() {
|
||||
securityFrameworkUtilsMock.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCreateUser() {
|
||||
// Arrange
|
||||
UserCreateRequestVO requestVO = randomPojo(UserCreateRequestVO.class);
|
||||
Long newUserId = randomLongId();
|
||||
when(adminUserService.createUser(any(UserSaveReqVO.class))).thenReturn(newUserId);
|
||||
|
||||
// Act
|
||||
UserCreateResponseVO response = userSyncService.createUser(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
assertEquals(String.valueOf(newUserId), response.getUid());
|
||||
assertEquals(requestVO.getBimRequestId(), response.getBimRequestId());
|
||||
|
||||
verify(adminUserService).createUser(any(UserSaveReqVO.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDeleteUser_Success() {
|
||||
// Arrange
|
||||
UserDeleteRequestVO requestVO = randomPojo(UserDeleteRequestVO.class);
|
||||
AdminUserDO existingUser = randomPojo(AdminUserDO.class);
|
||||
when(adminUserService.getUserByUsername(requestVO.getBimRemoteUser())).thenReturn(existingUser);
|
||||
|
||||
// Act
|
||||
UserDeleteResponseVO response = userSyncService.deleteUser(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
verify(adminUserService).deleteUser(requestVO.getBimUid());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDeleteUser_NotFound() {
|
||||
// Arrange
|
||||
UserDeleteRequestVO requestVO = randomPojo(UserDeleteRequestVO.class);
|
||||
when(adminUserService.getUserByUsername(requestVO.getBimRemoteUser())).thenReturn(null);
|
||||
|
||||
// Act
|
||||
UserDeleteResponseVO response = userSyncService.deleteUser(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("500", response.getResultCode());
|
||||
assertEquals("用户不存在", response.getMessage());
|
||||
verify(adminUserService, never()).deleteUser(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUpdateUser_Success() {
|
||||
// Arrange
|
||||
UserUpdateRequestVO requestVO = randomPojo(UserUpdateRequestVO.class, o -> o.setDeptIds(Set.of(randomLongId(), randomLongId())));
|
||||
AdminUserDO existingUser = randomPojo(AdminUserDO.class);
|
||||
existingUser.setStatus(0); // Active
|
||||
when(adminUserService.getUser(requestVO.getBimUid())).thenReturn(existingUser);
|
||||
|
||||
// Act
|
||||
UserUpdateResponseVO response = userSyncService.updateUser(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
assertTrue(response.get__ENABLE__());
|
||||
|
||||
verify(userDeptService).deleteUserDeptByUserId(existingUser.getId());
|
||||
verify(userDeptService).batchCreateUserDept(anyList());
|
||||
verify(adminUserService).updateUser(any(UserSaveReqVO.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUpdateUser_NotFound() {
|
||||
// Arrange
|
||||
UserUpdateRequestVO requestVO = randomPojo(UserUpdateRequestVO.class);
|
||||
when(adminUserService.getUser(requestVO.getBimUid())).thenReturn(null);
|
||||
|
||||
// Act
|
||||
UserUpdateResponseVO response = userSyncService.updateUser(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("500", response.getResultCode());
|
||||
assertEquals("用户不存在", response.getMessage());
|
||||
assertFalse(response.get__ENABLE__());
|
||||
verify(adminUserService, never()).updateUser(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetUserById_Success() {
|
||||
// Arrange
|
||||
UserGetRequestVO requestVO = new UserGetRequestVO();
|
||||
Long userId = randomLongId();
|
||||
requestVO.setBimUid(String.valueOf(userId));
|
||||
AdminUserDO user = randomPojo(AdminUserDO.class);
|
||||
user.setId(userId);
|
||||
when(adminUserService.getUser(userId)).thenReturn(user);
|
||||
|
||||
// Act
|
||||
UserGetResponseVO response = userSyncService.getUserById(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
assertNotNull(response.getAccount());
|
||||
assertEquals(user.getId(), response.getAccount().get("uid"));
|
||||
assertEquals(user.getUsername(), response.getAccount().get("username"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetUserById_NotFound() {
|
||||
// Arrange
|
||||
UserGetRequestVO requestVO = new UserGetRequestVO();
|
||||
Long userId = randomLongId();
|
||||
requestVO.setBimUid(String.valueOf(userId));
|
||||
when(adminUserService.getUser(userId)).thenReturn(null);
|
||||
|
||||
// Act
|
||||
UserGetResponseVO response = userSyncService.getUserById(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("500", response.getResultCode());
|
||||
assertEquals("用户不存在", response.getMessage());
|
||||
assertNull(response.getAccount());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetUserById_InvalidId() {
|
||||
// Arrange
|
||||
UserGetRequestVO requestVO = new UserGetRequestVO();
|
||||
requestVO.setBimUid("invalid-id");
|
||||
|
||||
// Act
|
||||
UserGetResponseVO response = userSyncService.getUserById(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("500", response.getResultCode());
|
||||
assertEquals("参数错误", response.getMessage());
|
||||
assertNull(response.getAccount());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testListUserIds() {
|
||||
// Arrange
|
||||
UserListRequestVO requestVO = randomPojo(UserListRequestVO.class);
|
||||
AdminUserDO user1 = randomPojo(AdminUserDO.class);
|
||||
AdminUserDO user2 = randomPojo(AdminUserDO.class);
|
||||
when(adminUserService.getUserListByStatus(0)).thenReturn(List.of(user1, user2));
|
||||
|
||||
// Act
|
||||
UserListResponseVO response = userSyncService.listUserIds(requestVO);
|
||||
|
||||
// Assert
|
||||
assertNotNull(response);
|
||||
assertEquals("0", response.getResultCode());
|
||||
assertEquals("success", response.getMessage());
|
||||
assertEquals(2, response.getUserIdList().size());
|
||||
assertTrue(response.getUserIdList().contains(String.valueOf(user1.getId())));
|
||||
assertTrue(response.getUserIdList().contains(String.valueOf(user2.getId())));
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest {
|
||||
Long userId = userService.createUser(reqVO);
|
||||
// 断言
|
||||
AdminUserDO user = userMapper.selectById(userId);
|
||||
assertPojoEquals(reqVO, user, "password", "id","deptIds");
|
||||
assertPojoEquals(reqVO, user, "password", "id","deptIds","status");
|
||||
assertEquals("yudaoyuanma", user.getPassword());
|
||||
assertEquals(CommonStatusEnum.ENABLE.getStatus(), user.getStatus());
|
||||
// 断言关联岗位
|
||||
@@ -181,7 +181,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest {
|
||||
userService.updateUser(reqVO);
|
||||
// 断言
|
||||
AdminUserDO user = userMapper.selectById(reqVO.getId());
|
||||
assertPojoEquals(reqVO, user, "password","deptIds");
|
||||
assertPojoEquals(reqVO, user, "avatar","password","deptIds");
|
||||
// 断言关联岗位
|
||||
List<UserPostDO> userPosts = userPostMapper.selectListByUserId(user.getId());
|
||||
assertEquals(2L, userPosts.get(0).getPostId());
|
||||
|
||||
Reference in New Issue
Block a user