fix: 优化对 JDK8 的兼容性

This commit is contained in:
YunaiV
2026-05-31 20:00:40 +08:00
parent f1660e18e4
commit ca702b81af
3 changed files with 9 additions and 9 deletions

View File

@ -1,5 +1,6 @@
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.extra.spring.SpringUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
@ -64,7 +65,7 @@ public class BpmTaskCandidateInvokerTest extends BaseMockitoUnitTest {
public void setUp() {
userStrategy = new BpmTaskCandidateUserStrategy(); // 创建 strategy 实例
when(emptyStrategy.getStrategy()).thenReturn(BpmTaskCandidateStrategyEnum.ASSIGN_EMPTY);
strategyList = List.of(userStrategy, emptyStrategy); // 创建 strategyList
strategyList = ListUtil.of(userStrategy, emptyStrategy); // 创建 strategyList
taskCandidateInvoker = new BpmTaskCandidateInvoker(strategyList, adminUserApi);
}

View File

@ -1,5 +1,6 @@
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;
@ -12,7 +13,6 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -41,7 +41,7 @@ public class BpmTaskCandidateStartUserSelectStrategyTest extends BaseMockitoUnit
// 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);
// 调用
@ -56,7 +56,7 @@ public class BpmTaskCandidateStartUserSelectStrategyTest extends BaseMockitoUnit
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,

View File

@ -22,7 +22,6 @@ import org.springframework.context.annotation.Import;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import java.math.RoundingMode;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime;
@ -162,7 +161,7 @@ public class BrokerageRecordServiceImplTest extends BaseDbUnitTest {
ProductSkuRespDTO sku = new ProductSkuRespDTO();
sku.setPrice(1000);
when(productSkuApi.getSkuListBySpuId(ListUtil.of(1L))).thenReturn(List.of(sku));
when(productSkuApi.getSkuListBySpuId(ListUtil.of(1L))).thenReturn(ListUtil.of(sku));
// 调用
AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 1L);
@ -190,7 +189,7 @@ public class BrokerageRecordServiceImplTest extends BaseDbUnitTest {
ProductSkuRespDTO sku = new ProductSkuRespDTO();
sku.setPrice(1000);
sku.setFirstBrokeragePrice(0);
when(productSkuApi.getSkuListBySpuId(ListUtil.of(2L))).thenReturn(List.of(sku));
when(productSkuApi.getSkuListBySpuId(ListUtil.of(2L))).thenReturn(ListUtil.of(sku));
// 调用
AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 2L);
@ -221,7 +220,7 @@ public class BrokerageRecordServiceImplTest extends BaseDbUnitTest {
ProductSkuRespDTO fixedBrokerageSku = new ProductSkuRespDTO();
fixedBrokerageSku.setPrice(2000);
fixedBrokerageSku.setFirstBrokeragePrice(200);
when(productSkuApi.getSkuListBySpuId(ListUtil.of(3L))).thenReturn(List.of(nullBrokerageSku, fixedBrokerageSku));
when(productSkuApi.getSkuListBySpuId(ListUtil.of(3L))).thenReturn(ListUtil.of(nullBrokerageSku, fixedBrokerageSku));
// 调用
AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 3L);
@ -245,7 +244,7 @@ public class BrokerageRecordServiceImplTest extends BaseDbUnitTest {
ProductSpuRespDTO spu = new ProductSpuRespDTO();
spu.setSubCommissionType(true);
when(productSpuApi.getSpu(4L)).thenReturn(spu);
when(productSkuApi.getSkuListBySpuId(ListUtil.of(4L))).thenReturn(List.of());
when(productSkuApi.getSkuListBySpuId(ListUtil.of(4L))).thenReturn(ListUtil.of());
// 调用
AppBrokerageProductPriceRespVO result = brokerageRecordService.calculateProductBrokeragePrice(100L, 4L);