|
|
|
|
@ -1,33 +1,26 @@
|
|
|
|
|
package cn.iocoder.yudao.module.mes.service.feedingrecord;
|
|
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.Disabled;
|
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
import org.springframework.boot.test.mock.mockito.MockBean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.feedingrecord.vo.*;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.feedingrecord.vo.FeedingRecordPageReqVO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.feedingrecord.vo.FeedingRecordRespVO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.feedingrecord.vo.FeedingRecordSaveReqVO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.feedingrecord.FeedingRecordDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.feedingrecord.FeedingRecordMapper;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.Disabled;
|
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
|
|
import static cn.hutool.core.util.RandomUtil.*;
|
|
|
|
|
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
|
|
|
|
|
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*;
|
|
|
|
|
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*;
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*;
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
|
|
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime;
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
|
|
|
|
|
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
|
|
|
|
|
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
|
|
|
|
|
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
|
|
|
|
|
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
|
|
|
|
|
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.FEEDING_RECORD_NOT_EXISTS;
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
|
import static org.mockito.Mockito.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* {@link FeedingRecordServiceImpl} 的单元测试类
|
|
|
|
|
@ -165,7 +158,7 @@ public class FeedingRecordServiceImplTest extends BaseDbUnitTest {
|
|
|
|
|
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
|
|
|
|
|
|
|
|
|
// 调用
|
|
|
|
|
PageResult<FeedingRecordDO> pageResult = feedingRecordService.getFeedingRecordPage(reqVO);
|
|
|
|
|
PageResult<FeedingRecordRespVO> pageResult = feedingRecordService.getFeedingRecordPage(reqVO);
|
|
|
|
|
// 断言
|
|
|
|
|
assertEquals(1, pageResult.getTotal());
|
|
|
|
|
assertEquals(1, pageResult.getList().size());
|
|
|
|
|
|