【同步】BOOT 和 CLOUD 的功能
parent
2031f42396
commit
18b63f4e05
|
@ -1,5 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate;
|
package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.extra.spring.SpringUtil;
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
|
@ -64,7 +65,7 @@ public class BpmTaskCandidateInvokerTest extends BaseMockitoUnitTest {
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
userStrategy = new BpmTaskCandidateUserStrategy(); // 创建 strategy 实例
|
userStrategy = new BpmTaskCandidateUserStrategy(); // 创建 strategy 实例
|
||||||
when(emptyStrategy.getStrategy()).thenReturn(BpmTaskCandidateStrategyEnum.ASSIGN_EMPTY);
|
when(emptyStrategy.getStrategy()).thenReturn(BpmTaskCandidateStrategyEnum.ASSIGN_EMPTY);
|
||||||
strategyList = List.of(userStrategy, emptyStrategy); // 创建 strategyList
|
strategyList = ListUtil.of(userStrategy, emptyStrategy); // 创建 strategyList
|
||||||
taskCandidateInvoker = new BpmTaskCandidateInvoker(strategyList, adminUserApi);
|
taskCandidateInvoker = new BpmTaskCandidateInvoker(strategyList, adminUserApi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.strategy.dept;
|
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.hutool.core.map.MapUtil;
|
||||||
import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest;
|
import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest;
|
||||||
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmnVariableConstants;
|
import cn.iocoder.yudao.module.bpm.framework.flowable.core.enums.BpmnVariableConstants;
|
||||||
|
@ -41,7 +42,7 @@ public class BpmTaskCandidateStartUserSelectStrategyTest extends BaseMockitoUnit
|
||||||
// mock 方法(FlowableUtils)
|
// mock 方法(FlowableUtils)
|
||||||
Map<String, Object> processVariables = new HashMap<>();
|
Map<String, Object> processVariables = new HashMap<>();
|
||||||
processVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES,
|
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);
|
when(processInstance.getProcessVariables()).thenReturn(processVariables);
|
||||||
|
|
||||||
// 调用
|
// 调用
|
||||||
|
@ -56,7 +57,7 @@ public class BpmTaskCandidateStartUserSelectStrategyTest extends BaseMockitoUnit
|
||||||
String activityId = "activity_001";
|
String activityId = "activity_001";
|
||||||
Map<String, Object> processVariables = new HashMap<>();
|
Map<String, Object> processVariables = new HashMap<>();
|
||||||
processVariables.put(BpmnVariableConstants.PROCESS_INSTANCE_VARIABLE_START_USER_SELECT_ASSIGNEES,
|
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,
|
Set<Long> userIds = strategy.calculateUsersByActivity(null, activityId, null,
|
||||||
|
|
|
@ -8,9 +8,9 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import jakarta.validation.constraints.AssertTrue;
|
import javax.validation.constraints.AssertTrue;
|
||||||
import jakarta.validation.constraints.Min;
|
import javax.validation.constraints.Min;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
Loading…
Reference in New Issue