1. 中铝e办组织机构人员同步联调接口
2. 设置默认文件预览水印为人员加日期
(cherry picked from commit 07c9ead358)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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())));
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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