完善 DeptServiceImpl 单元测试
This commit is contained in:
@@ -216,7 +216,7 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService {
|
||||
roleApi.validRoles(options);
|
||||
} else if (ObjectUtils.equalsAny(type, BpmTaskAssignRuleTypeEnum.DEPT_MEMBER.getType(),
|
||||
BpmTaskAssignRuleTypeEnum.DEPT_LEADER.getType())) {
|
||||
deptApi.validDepts(options);
|
||||
deptApi.validateDeptList(options);
|
||||
} else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.POST.getType())) {
|
||||
postApi.validPosts(options);
|
||||
} else if (Objects.equals(type, BpmTaskAssignRuleTypeEnum.USER.getType())) {
|
||||
@@ -293,7 +293,7 @@ public class BpmTaskAssignRuleServiceImpl implements BpmTaskAssignRuleService {
|
||||
}
|
||||
|
||||
private Set<Long> calculateTaskCandidateUsersByDeptLeader(BpmTaskAssignRuleDO rule) {
|
||||
List<DeptRespDTO> depts = deptApi.getDepts(rule.getOptions()).getCheckedData();
|
||||
List<DeptRespDTO> depts = deptApi.getDeptList(rule.getOptions()).getCheckedData();
|
||||
return convertSet(depts, DeptRespDTO::getLeaderUserId);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ public class BpmTaskAssignRuleServiceImplTest extends BaseDbUnitTest {
|
||||
// mock 方法
|
||||
DeptRespDTO dept1 = randomPojo(DeptRespDTO.class, o -> o.setLeaderUserId(11L));
|
||||
DeptRespDTO dept2 = randomPojo(DeptRespDTO.class, o -> o.setLeaderUserId(22L));
|
||||
when(deptApi.getDepts(eq(rule.getOptions()))).thenReturn(success(Arrays.asList(dept1, dept2)));
|
||||
when(deptApi.getDeptList(eq(rule.getOptions()))).thenReturn(success(Arrays.asList(dept1, dept2)));
|
||||
mockGetUserMap(asSet(11L, 22L));
|
||||
|
||||
// 调用
|
||||
|
||||
Reference in New Issue
Block a user