mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-24 16:05:08 +08:00
完善 AdminUserServiceImpl 单元测试
This commit is contained in:
@ -220,7 +220,7 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService {
|
||||
} else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.POST.getType())) {
|
||||
postApi.validPostList(options);
|
||||
} else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.USER.getType())) {
|
||||
adminUserApi.validUsers(options);
|
||||
adminUserApi.validateUserList(options);
|
||||
} else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.USER_GROUP.getType())) {
|
||||
userGroupService.validUserGroups(options);
|
||||
} else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.SCRIPT.getType())) {
|
||||
@ -288,7 +288,7 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService {
|
||||
}
|
||||
|
||||
private Set<Long> calculateTaskCandidateUsersByDeptMember(BpmTaskAssignRuleDO rule) {
|
||||
List<AdminUserRespDTO> users = adminUserApi.getUsersByDeptIds(rule.getOptions());
|
||||
List<AdminUserRespDTO> users = adminUserApi.getUserListByDeptIds(rule.getOptions());
|
||||
return convertSet(users, AdminUserRespDTO::getId);
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class BpmTaskAssignRuleServiceImplTest extends BaseDbUnitTest {
|
||||
// mock 方法
|
||||
List<AdminUserRespDTO> users = CollectionUtils.convertList(asSet(11L, 22L),
|
||||
id -> new AdminUserRespDTO().setId(id));
|
||||
when(adminUserApi.getUsersByDeptIds(eq(rule.getOptions()))).thenReturn(users);
|
||||
when(adminUserApi.getUserListByDeptIds(eq(rule.getOptions()))).thenReturn(users);
|
||||
mockGetUserMap(asSet(11L, 22L));
|
||||
|
||||
// 调用
|
||||
|
Reference in New Issue
Block a user