优化 mp 账号的刷新机制,使用 Job 轮询,替换 MQ 广播

This commit is contained in:
YunaiV
2023-07-27 20:25:15 +08:00
parent 5d6308e4bb
commit c33186569d
14 changed files with 62 additions and 115 deletions

View File

@@ -40,6 +40,8 @@ public class BpmTaskAssignLeaderX2ScriptTest extends BaseMockitoUnitTest {
// mock 方法(startUser)
AdminUserRespDTO startUser = randomPojo(AdminUserRespDTO.class, o -> o.setDeptId(10L));
when(adminUserApi.getUser(eq(1L))).thenReturn(startUser);
// mock 方法(getStartUserDept)没有部门
when(deptApi.getDept(eq(10L))).thenReturn(null);
// 调用
Set<Long> result = script.calculateTaskCandidateUsers(execution);
@@ -56,7 +58,9 @@ public class BpmTaskAssignLeaderX2ScriptTest extends BaseMockitoUnitTest {
when(adminUserApi.getUser(eq(1L))).thenReturn(startUser);
DeptRespDTO startUserDept = randomPojo(DeptRespDTO.class, o -> o.setId(10L).setParentId(100L)
.setLeaderUserId(20L));
// mock 方法getDept
when(deptApi.getDept(eq(10L))).thenReturn(startUserDept);
when(deptApi.getDept(eq(100L))).thenReturn(null);
// 调用
Set<Long> result = script.calculateTaskCandidateUsers(execution);