Commit 2a415b334abf9d009b1c1be68a3b745fa72243ca
1 parent
4e381400
feat(mes):优化 JDK8 的兼容性
Showing
3 changed files
with
10 additions
and
7 deletions
yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/dal/mysql/pro/task/MesProTaskMapperTest.java
| 1 | 1 | package cn.iocoder.yudao.module.mes.dal.mysql.pro.task; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.ListUtil; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 5 | import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; |
| 5 | 6 | import cn.iocoder.yudao.module.mes.controller.admin.pro.task.vo.MesProTaskPageReqVO; |
| ... | ... | @@ -122,7 +123,7 @@ public class MesProTaskMapperTest extends BaseDbUnitTest { |
| 122 | 123 | taskMapper.insert(task3); |
| 123 | 124 | |
| 124 | 125 | MesProTaskPageReqVO reqVO = new MesProTaskPageReqVO(); |
| 125 | - reqVO.setStatuses(List.of(1, 2)); | |
| 126 | + reqVO.setStatuses(ListUtil.of(1, 2)); | |
| 126 | 127 | PageResult<MesProTaskDO> result = taskMapper.selectPage(reqVO); |
| 127 | 128 | |
| 128 | 129 | assertEquals(2, result.getTotal()); | ... | ... |
yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/cal/team/MesCalTeamShiftServiceImplTest.java
| 1 | 1 | package cn.iocoder.yudao.module.mes.service.cal.team; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.ListUtil; | |
| 3 | 4 | import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; |
| 4 | 5 | import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanDO; |
| 5 | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanShiftDO; |
| ... | ... | @@ -61,12 +62,12 @@ public class MesCalTeamShiftServiceImplTest extends BaseDbUnitTest { |
| 61 | 62 | .shiftMethod(MesCalShiftMethodEnum.DAY.getMethod()) |
| 62 | 63 | .shiftCount(1) |
| 63 | 64 | .build(); |
| 64 | - List<MesCalPlanShiftDO> shifts = List.of( | |
| 65 | + List<MesCalPlanShiftDO> shifts = ListUtil.of( | |
| 65 | 66 | MesCalPlanShiftDO.builder().id(11L).planId(planId).sort(1).name("白班").startTime("08:00").endTime("16:00").build(), |
| 66 | 67 | MesCalPlanShiftDO.builder().id(12L).planId(planId).sort(2).name("中班").startTime("16:00").endTime("00:00").build(), |
| 67 | 68 | MesCalPlanShiftDO.builder().id(13L).planId(planId).sort(3).name("夜班").startTime("00:00").endTime("08:00").build() |
| 68 | 69 | ); |
| 69 | - List<MesCalPlanTeamDO> teams = List.of( | |
| 70 | + List<MesCalPlanTeamDO> teams = ListUtil.of( | |
| 70 | 71 | MesCalPlanTeamDO.builder().id(21L).planId(planId).teamId(101L).build(), |
| 71 | 72 | MesCalPlanTeamDO.builder().id(22L).planId(planId).teamId(102L).build(), |
| 72 | 73 | MesCalPlanTeamDO.builder().id(23L).planId(planId).teamId(103L).build() | ... | ... |
yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/qc/indicatorresult/MesQcIndicatorResultServiceImplTest.java
| 1 | 1 | package cn.iocoder.yudao.module.mes.service.qc.indicatorresult; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.ListUtil; | |
| 3 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 5 | import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; |
| 5 | 6 | import cn.iocoder.yudao.module.mes.controller.admin.qc.indicatorresult.vo.MesQcIndicatorResultPageReqVO; |
| ... | ... | @@ -16,12 +17,11 @@ import cn.iocoder.yudao.module.mes.service.qc.iqc.MesQcIqcService; |
| 16 | 17 | import cn.iocoder.yudao.module.mes.service.qc.oqc.MesQcOqcService; |
| 17 | 18 | import cn.iocoder.yudao.module.mes.service.qc.rqc.MesQcRqcService; |
| 18 | 19 | import cn.iocoder.yudao.module.system.api.dict.DictDataApi; |
| 20 | +import jakarta.annotation.Resource; | |
| 19 | 21 | import org.junit.jupiter.api.Test; |
| 20 | 22 | import org.springframework.context.annotation.Import; |
| 21 | 23 | import org.springframework.test.context.bean.override.mockito.MockitoBean; |
| 22 | 24 | |
| 23 | -import jakarta.annotation.Resource; | |
| 24 | -import java.util.List; | |
| 25 | 25 | import java.util.Map; |
| 26 | 26 | |
| 27 | 27 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| ... | ... | @@ -31,7 +31,8 @@ import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId |
| 31 | 31 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; |
| 32 | 32 | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; |
| 33 | 33 | import static org.junit.jupiter.api.Assertions.*; |
| 34 | -import static org.mockito.ArgumentMatchers.*; | |
| 34 | +import static org.mockito.ArgumentMatchers.anyList; | |
| 35 | +import static org.mockito.ArgumentMatchers.anySet; | |
| 35 | 36 | import static org.mockito.Mockito.*; |
| 36 | 37 | |
| 37 | 38 | /** |
| ... | ... | @@ -281,7 +282,7 @@ public class MesQcIndicatorResultServiceImplTest extends BaseDbUnitTest { |
| 281 | 282 | reqVO.setCode("SPL-001"); |
| 282 | 283 | reqVO.setQcId(1L); |
| 283 | 284 | reqVO.setQcType(MesQcTypeEnum.IQC.getType()); |
| 284 | - reqVO.setItems(List.of(item)); | |
| 285 | + reqVO.setItems(ListUtil.of(item)); | |
| 285 | 286 | return reqVO; |
| 286 | 287 | } |
| 287 | 288 | ... | ... |