| | |
| | | package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.dept; |
| | | |
| | | import cn.hutool.core.collection.ListUtil; |
| | | import cn.hutool.core.map.MapUtil; |
| | | import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; |
| | | import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmnVariableConstants; |
| | |
| | | import org.mockito.Mock; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | |
| | | // mock 方法(FlowableUtils) |
| | | Map<String, Object> processVariables = new HashMap<>(); |
| | | processVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES, |
| | | MapUtil.of("activity_001", List.of(1L, 2L))); |
| | | MapUtil.of("activity_001", ListUtil.of(1L, 2L))); |
| | | when(processInstance.getProcessVariables()).thenReturn(processVariables); |
| | | |
| | | // 调用 |
| | |
| | | String activityId = "activity_001"; |
| | | Map<String, Object> processVariables = new HashMap<>(); |
| | | processVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES, |
| | | MapUtil.of("activity_001", List.of(1L, 2L))); |
| | | MapUtil.of("activity_001", ListUtil.of(1L, 2L))); |
| | | |
| | | // 调用 |
| | | Set<Long> userIds = strategy.calculateUsersByActivity(null, activityId, null, |