Browse Source

修改配置文件

gaohp 11 months ago
parent
commit
4d9334a1b7
12 changed files with 8 additions and 1363 deletions
  1. 2 2
      feifan-module-distri/feifan-module-distri-api/pom.xml
  2. 2 2
      feifan-module-distri/feifan-module-distri-biz/pom.xml
  3. 0 146
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/integral/IntegralServiceImplTest.java
  4. 0 166
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcServiceImplTest.java
  5. 0 154
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageServiceImplTest.java
  6. 0 154
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersServiceImplTest.java
  7. 0 154
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonServiceImplTest.java
  8. 0 146
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathServiceImplTest.java
  9. 0 142
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/socialstatus/SocialStatusServiceImplTest.java
  10. 0 134
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/source/SourceServiceImplTest.java
  11. 0 162
      feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/user/UserServiceImplTest.java
  12. 4 1
      feifan-server/src/main/java/cn/newfeifan/mall/server/FeifanServerApplication.java

+ 2 - 2
feifan-module-distri/feifan-module-distri-api/pom.xml

@@ -6,7 +6,7 @@
         <artifactId>feifan-module-distri</artifactId>
         <artifactId>feifan-module-distri</artifactId>
         <version>${revision}</version>
         <version>${revision}</version>
     </parent>
     </parent>
-
+    <name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
     <artifactId>feifan-module-distri-api</artifactId>
     <artifactId>feifan-module-distri-api</artifactId>
     <packaging>jar</packaging>
     <packaging>jar</packaging>
 
 
@@ -16,7 +16,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
     </properties>
 
 
-    <name>${project.artifactId}</name> <!-- 3. 新增 name 为 ${project.artifactId} -->
+
 
 
     <description> <!-- 4. 新增 description 为该模块的描述 -->
     <description> <!-- 4. 新增 description 为该模块的描述 -->
         营销模块 模块,主要实现 身价, 积分, 分销计算等功能。
         营销模块 模块,主要实现 身价, 积分, 分销计算等功能。

+ 2 - 2
feifan-module-distri/feifan-module-distri-biz/pom.xml

@@ -6,7 +6,7 @@
         <artifactId>feifan-module-distri</artifactId>
         <artifactId>feifan-module-distri</artifactId>
         <version>${revision}</version>
         <version>${revision}</version>
     </parent>
     </parent>
-
+    <name>${project.artifactId}</name>
     <artifactId>feifan-module-distri-biz</artifactId>
     <artifactId>feifan-module-distri-biz</artifactId>
     <packaging>jar</packaging>
     <packaging>jar</packaging>
 
 
@@ -17,7 +17,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
     </properties>
 
 
-    <name>${project.artifactId}</name>
+
 
 
     <description>
     <description>
         营销模块 模块,主要实现 身价, 积分, 分销计算等功能。
         营销模块 模块,主要实现 身价, 积分, 分销计算等功能。

+ 0 - 146
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/integral/IntegralServiceImplTest.java

@@ -1,146 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.integral;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.newfeifan.mall.module.distri.controller.admin.integral.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.integral.IntegralDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.integral.IntegralMapper;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
-import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
-import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
- * {@link IntegralServiceImpl} 的单元测试类
- *
- * @author 非繁人
- */
-@Import(IntegralServiceImpl.class)
-public class IntegralServiceImplTest extends BaseDbUnitTest {
-
-    @Resource
-    private IntegralServiceImpl integralService;
-
-    @Resource
-    private IntegralMapper integralMapper;
-
-    @Test
-    public void testCreateIntegral_success() {
-        // 准备参数
-        IntegralSaveReqVO createReqVO = randomPojo(IntegralSaveReqVO.class).setId(null);
-
-        // 调用
-        Long integralId = integralService.createIntegral(createReqVO);
-        // 断言
-        assertNotNull(integralId);
-        // 校验记录的属性是否正确
-        IntegralDO integral = integralMapper.selectById(integralId);
-        assertPojoEquals(createReqVO, integral, "id");
-    }
-
-    @Test
-    public void testUpdateIntegral_success() {
-        // mock 数据
-        IntegralDO dbIntegral = randomPojo(IntegralDO.class);
-        integralMapper.insert(dbIntegral);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        IntegralSaveReqVO updateReqVO = randomPojo(IntegralSaveReqVO.class, o -> {
-            o.setId(dbIntegral.getId()); // 设置更新的 ID
-        });
-
-        // 调用
-        integralService.updateIntegral(updateReqVO);
-        // 校验是否更新正确
-        IntegralDO integral = integralMapper.selectById(updateReqVO.getId()); // 获取最新的
-        assertPojoEquals(updateReqVO, integral);
-    }
-
-    @Test
-    public void testUpdateIntegral_notExists() {
-        // 准备参数
-        IntegralSaveReqVO updateReqVO = randomPojo(IntegralSaveReqVO.class);
-
-        // 调用, 并断言异常
-        assertServiceException(() -> integralService.updateIntegral(updateReqVO), INTEGRAL_NOT_EXISTS);
-    }
-
-    @Test
-    public void testDeleteIntegral_success() {
-        // mock 数据
-        IntegralDO dbIntegral = randomPojo(IntegralDO.class);
-        integralMapper.insert(dbIntegral);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        Long id = dbIntegral.getId();
-
-        // 调用
-        integralService.deleteIntegral(id);
-       // 校验数据不存在了
-       assertNull(integralMapper.selectById(id));
-    }
-
-    @Test
-    public void testDeleteIntegral_notExists() {
-        // 准备参数
-        Long id = randomLongId();
-
-        // 调用, 并断言异常
-        assertServiceException(() -> integralService.deleteIntegral(id), INTEGRAL_NOT_EXISTS);
-    }
-
-    @Test
-    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
-    public void testGetIntegralPage() {
-       // mock 数据
-       IntegralDO dbIntegral = randomPojo(IntegralDO.class, o -> { // 等会查询到
-           o.setUserId(null);
-           o.setCurrentQuota(null);
-           o.setFreezeQuota(null);
-           o.setCategoryId(null);
-           o.setCreateTime(null);
-       });
-       integralMapper.insert(dbIntegral);
-       // 测试 userId 不匹配
-       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setUserId(null)));
-       // 测试 currentQuota 不匹配
-       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setCurrentQuota(null)));
-       // 测试 freezeQuota 不匹配
-       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setFreezeQuota(null)));
-       // 测试 categoryId 不匹配
-       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setCategoryId(null)));
-       // 测试 createTime 不匹配
-       integralMapper.insert(cloneIgnoreId(dbIntegral, o -> o.setCreateTime(null)));
-       // 准备参数
-       IntegralPageReqVO reqVO = new IntegralPageReqVO();
-       reqVO.setUserId(null);
-       reqVO.setCurrentQuota(null);
-       reqVO.setFreezeQuota(null);
-       reqVO.setCategoryId(null);
-       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-
-       // 调用
-       PageResult<IntegralDO> pageResult = integralService.getIntegralPage(reqVO);
-       // 断言
-       assertEquals(1, pageResult.getTotal());
-       assertEquals(1, pageResult.getList().size());
-       assertPojoEquals(dbIntegral, pageResult.getList().get(0));
-    }
-
-}

+ 0 - 166
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/ordercalc/OrderCalcServiceImplTest.java

@@ -1,166 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.ordercalc;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.newfeifan.mall.module.distri.controller.admin.ordercalc.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.ordercalc.OrderCalcDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.ordercalc.OrderCalcMapper;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
-import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
-import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
- * {@link OrderCalcServiceImpl} 的单元测试类
- *
- * @author 非繁人
- */
-@Import(OrderCalcServiceImpl.class)
-public class OrderCalcServiceImplTest extends BaseDbUnitTest {
-
-    @Resource
-    private OrderCalcServiceImpl orderCalcService;
-
-    @Resource
-    private OrderCalcMapper orderCalcMapper;
-
-    @Test
-    public void testCreateOrderCalc_success() {
-        // 准备参数
-        OrderCalcSaveReqVO createReqVO = randomPojo(OrderCalcSaveReqVO.class).setId(null);
-
-        // 调用
-        Long orderCalcId = orderCalcService.createOrderCalc(createReqVO);
-        // 断言
-        assertNotNull(orderCalcId);
-        // 校验记录的属性是否正确
-        OrderCalcDO orderCalc = orderCalcMapper.selectById(orderCalcId);
-        assertPojoEquals(createReqVO, orderCalc, "id");
-    }
-
-    @Test
-    public void testUpdateOrderCalc_success() {
-        // mock 数据
-        OrderCalcDO dbOrderCalc = randomPojo(OrderCalcDO.class);
-        orderCalcMapper.insert(dbOrderCalc);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        OrderCalcSaveReqVO updateReqVO = randomPojo(OrderCalcSaveReqVO.class, o -> {
-            o.setId(dbOrderCalc.getId()); // 设置更新的 ID
-        });
-
-        // 调用
-        orderCalcService.updateOrderCalc(updateReqVO);
-        // 校验是否更新正确
-        OrderCalcDO orderCalc = orderCalcMapper.selectById(updateReqVO.getId()); // 获取最新的
-        assertPojoEquals(updateReqVO, orderCalc);
-    }
-
-    @Test
-    public void testUpdateOrderCalc_notExists() {
-        // 准备参数
-        OrderCalcSaveReqVO updateReqVO = randomPojo(OrderCalcSaveReqVO.class);
-
-        // 调用, 并断言异常
-        assertServiceException(() -> orderCalcService.updateOrderCalc(updateReqVO), ORDER_CALC_NOT_EXISTS);
-    }
-
-    @Test
-    public void testDeleteOrderCalc_success() {
-        // mock 数据
-        OrderCalcDO dbOrderCalc = randomPojo(OrderCalcDO.class);
-        orderCalcMapper.insert(dbOrderCalc);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        Long id = dbOrderCalc.getId();
-
-        // 调用
-        orderCalcService.deleteOrderCalc(id);
-       // 校验数据不存在了
-       assertNull(orderCalcMapper.selectById(id));
-    }
-
-    @Test
-    public void testDeleteOrderCalc_notExists() {
-        // 准备参数
-        Long id = randomLongId();
-
-        // 调用, 并断言异常
-        assertServiceException(() -> orderCalcService.deleteOrderCalc(id), ORDER_CALC_NOT_EXISTS);
-    }
-
-    @Test
-    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
-    public void testGetOrderCalcPage() {
-       // mock 数据
-       OrderCalcDO dbOrderCalc = randomPojo(OrderCalcDO.class, o -> { // 等会查询到
-           o.setOrderNo(null);
-           o.setUserId(null);
-           o.setPrice(null);
-           o.setCost(null);
-           o.setGrossProfit(null);
-           o.setGrossProfitUserQuota(null);
-           o.setGrossProfitAncestorQuota(null);
-           o.setGrossProfitBonusQuota(null);
-           o.setGrossProfitPlatformQuota(null);
-           o.setCreateTime(null);
-       });
-       orderCalcMapper.insert(dbOrderCalc);
-       // 测试 orderNo 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setOrderNo(null)));
-       // 测试 userId 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setUserId(null)));
-       // 测试 price 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setPrice(null)));
-       // 测试 cost 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setCost(null)));
-       // 测试 grossProfit 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfit(null)));
-       // 测试 grossProfitUserQuota 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfitUserQuota(null)));
-       // 测试 grossProfitAncestorQuota 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfitAncestorQuota(null)));
-       // 测试 grossProfitBonusQuota 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfitBonusQuota(null)));
-       // 测试 grossProfitPlatformQuota 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setGrossProfitPlatformQuota(null)));
-       // 测试 createTime 不匹配
-       orderCalcMapper.insert(cloneIgnoreId(dbOrderCalc, o -> o.setCreateTime(null)));
-       // 准备参数
-       OrderCalcPageReqVO reqVO = new OrderCalcPageReqVO();
-       reqVO.setOrderNo(null);
-       reqVO.setUserId(null);
-       reqVO.setPrice(null);
-       reqVO.setCost(null);
-       reqVO.setGrossProfit(null);
-       reqVO.setGrossProfitUserQuota(null);
-       reqVO.setGrossProfitAncestorQuota(null);
-       reqVO.setGrossProfitBonusQuota(null);
-       reqVO.setGrossProfitPlatformQuota(null);
-       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-
-       // 调用
-       PageResult<OrderCalcDO> pageResult = orderCalcService.getOrderCalcPage(reqVO);
-       // 断言
-       assertEquals(1, pageResult.getTotal());
-       assertEquals(1, pageResult.getList().size());
-       assertPojoEquals(dbOrderCalc, pageResult.getList().get(0));
-    }
-
-}

+ 0 - 154
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/orderpercentage/OrderPercentageServiceImplTest.java

@@ -1,154 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.orderpercentage;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.newfeifan.mall.module.distri.controller.admin.orderpercentage.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.orderpercentage.OrderPercentageDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.orderpercentage.OrderPercentageMapper;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
-import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
-import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
- * {@link OrderPercentageServiceImpl} 的单元测试类
- *
- * @author 非繁人
- */
-@Import(OrderPercentageServiceImpl.class)
-public class OrderPercentageServiceImplTest extends BaseDbUnitTest {
-
-    @Resource
-    private OrderPercentageServiceImpl orderPercentageService;
-
-    @Resource
-    private OrderPercentageMapper orderPercentageMapper;
-
-    @Test
-    public void testCreateOrderPercentage_success() {
-        // 准备参数
-        OrderPercentageSaveReqVO createReqVO = randomPojo(OrderPercentageSaveReqVO.class).setId(null);
-
-        // 调用
-        Long orderPercentageId = orderPercentageService.createOrderPercentage(createReqVO);
-        // 断言
-        assertNotNull(orderPercentageId);
-        // 校验记录的属性是否正确
-        OrderPercentageDO orderPercentage = orderPercentageMapper.selectById(orderPercentageId);
-        assertPojoEquals(createReqVO, orderPercentage, "id");
-    }
-
-    @Test
-    public void testUpdateOrderPercentage_success() {
-        // mock 数据
-        OrderPercentageDO dbOrderPercentage = randomPojo(OrderPercentageDO.class);
-        orderPercentageMapper.insert(dbOrderPercentage);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        OrderPercentageSaveReqVO updateReqVO = randomPojo(OrderPercentageSaveReqVO.class, o -> {
-            o.setId(dbOrderPercentage.getId()); // 设置更新的 ID
-        });
-
-        // 调用
-        orderPercentageService.updateOrderPercentage(updateReqVO);
-        // 校验是否更新正确
-        OrderPercentageDO orderPercentage = orderPercentageMapper.selectById(updateReqVO.getId()); // 获取最新的
-        assertPojoEquals(updateReqVO, orderPercentage);
-    }
-
-    @Test
-    public void testUpdateOrderPercentage_notExists() {
-        // 准备参数
-        OrderPercentageSaveReqVO updateReqVO = randomPojo(OrderPercentageSaveReqVO.class);
-
-        // 调用, 并断言异常
-        assertServiceException(() -> orderPercentageService.updateOrderPercentage(updateReqVO), ORDER_PERCENTAGE_NOT_EXISTS);
-    }
-
-    @Test
-    public void testDeleteOrderPercentage_success() {
-        // mock 数据
-        OrderPercentageDO dbOrderPercentage = randomPojo(OrderPercentageDO.class);
-        orderPercentageMapper.insert(dbOrderPercentage);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        Long id = dbOrderPercentage.getId();
-
-        // 调用
-        orderPercentageService.deleteOrderPercentage(id);
-       // 校验数据不存在了
-       assertNull(orderPercentageMapper.selectById(id));
-    }
-
-    @Test
-    public void testDeleteOrderPercentage_notExists() {
-        // 准备参数
-        Long id = randomLongId();
-
-        // 调用, 并断言异常
-        assertServiceException(() -> orderPercentageService.deleteOrderPercentage(id), ORDER_PERCENTAGE_NOT_EXISTS);
-    }
-
-    @Test
-    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
-    public void testGetOrderPercentagePage() {
-       // mock 数据
-       OrderPercentageDO dbOrderPercentage = randomPojo(OrderPercentageDO.class, o -> { // 等会查询到
-           o.setGrossProfitPerc(null);
-           o.setGrossProfitUserQuotaPerc(null);
-           o.setGrossProfitAncestorQuotaPerc(null);
-           o.setGrossProfitBonusQuotaPerc(null);
-           o.setGrossProfitPlatformQuotaPerc(null);
-           o.setDivideIntoPerc(null);
-           o.setCreateTime(null);
-       });
-       orderPercentageMapper.insert(dbOrderPercentage);
-       // 测试 grossProfitPerc 不匹配
-       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitPerc(null)));
-       // 测试 grossProfitUserQuotaPerc 不匹配
-       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitUserQuotaPerc(null)));
-       // 测试 grossProfitAncestorQuotaPerc 不匹配
-       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitAncestorQuotaPerc(null)));
-       // 测试 grossProfitBonusQuotaPerc 不匹配
-       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitBonusQuotaPerc(null)));
-       // 测试 grossProfitPlatformQuotaPerc 不匹配
-       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setGrossProfitPlatformQuotaPerc(null)));
-       // 测试 divideIntoPerc 不匹配
-       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setDivideIntoPerc(null)));
-       // 测试 createTime 不匹配
-       orderPercentageMapper.insert(cloneIgnoreId(dbOrderPercentage, o -> o.setCreateTime(null)));
-       // 准备参数
-       OrderPercentagePageReqVO reqVO = new OrderPercentagePageReqVO();
-       reqVO.setGrossProfitPerc(null);
-       reqVO.setGrossProfitUserQuotaPerc(null);
-       reqVO.setGrossProfitAncestorQuotaPerc(null);
-       reqVO.setGrossProfitBonusQuotaPerc(null);
-       reqVO.setGrossProfitPlatformQuotaPerc(null);
-       reqVO.setDivideIntoPerc(null);
-       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-
-       // 调用
-       PageResult<OrderPercentageDO> pageResult = orderPercentageService.getOrderPercentagePage(reqVO);
-       // 断言
-       assertEquals(1, pageResult.getTotal());
-       assertEquals(1, pageResult.getList().size());
-       assertPojoEquals(dbOrderPercentage, pageResult.getList().get(0));
-    }
-
-}

+ 0 - 154
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/partitionbrothers/PartitionBrothersServiceImplTest.java

@@ -1,154 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.partitionbrothers;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.newfeifan.mall.module.distri.controller.admin.partitionbrothers.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.partitionbrothers.PartitionBrothersDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.partitionbrothers.PartitionBrothersMapper;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
-import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
-import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
- * {@link PartitionBrothersServiceImpl} 的单元测试类
- *
- * @author 非繁人
- */
-@Import(PartitionBrothersServiceImpl.class)
-public class PartitionBrothersServiceImplTest extends BaseDbUnitTest {
-
-    @Resource
-    private PartitionBrothersServiceImpl partitionBrothersService;
-
-    @Resource
-    private PartitionBrothersMapper partitionBrothersMapper;
-
-    @Test
-    public void testCreatePartitionBrothers_success() {
-        // 准备参数
-        PartitionBrothersSaveReqVO createReqVO = randomPojo(PartitionBrothersSaveReqVO.class).setId(null);
-
-        // 调用
-        Long partitionBrothersId = partitionBrothersService.createPartitionBrothers(createReqVO);
-        // 断言
-        assertNotNull(partitionBrothersId);
-        // 校验记录的属性是否正确
-        PartitionBrothersDO partitionBrothers = partitionBrothersMapper.selectById(partitionBrothersId);
-        assertPojoEquals(createReqVO, partitionBrothers, "id");
-    }
-
-    @Test
-    public void testUpdatePartitionBrothers_success() {
-        // mock 数据
-        PartitionBrothersDO dbPartitionBrothers = randomPojo(PartitionBrothersDO.class);
-        partitionBrothersMapper.insert(dbPartitionBrothers);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        PartitionBrothersSaveReqVO updateReqVO = randomPojo(PartitionBrothersSaveReqVO.class, o -> {
-            o.setId(dbPartitionBrothers.getId()); // 设置更新的 ID
-        });
-
-        // 调用
-        partitionBrothersService.updatePartitionBrothers(updateReqVO);
-        // 校验是否更新正确
-        PartitionBrothersDO partitionBrothers = partitionBrothersMapper.selectById(updateReqVO.getId()); // 获取最新的
-        assertPojoEquals(updateReqVO, partitionBrothers);
-    }
-
-    @Test
-    public void testUpdatePartitionBrothers_notExists() {
-        // 准备参数
-        PartitionBrothersSaveReqVO updateReqVO = randomPojo(PartitionBrothersSaveReqVO.class);
-
-        // 调用, 并断言异常
-        assertServiceException(() -> partitionBrothersService.updatePartitionBrothers(updateReqVO), PARTITION_BROTHERS_NOT_EXISTS);
-    }
-
-    @Test
-    public void testDeletePartitionBrothers_success() {
-        // mock 数据
-        PartitionBrothersDO dbPartitionBrothers = randomPojo(PartitionBrothersDO.class);
-        partitionBrothersMapper.insert(dbPartitionBrothers);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        Long id = dbPartitionBrothers.getId();
-
-        // 调用
-        partitionBrothersService.deletePartitionBrothers(id);
-       // 校验数据不存在了
-       assertNull(partitionBrothersMapper.selectById(id));
-    }
-
-    @Test
-    public void testDeletePartitionBrothers_notExists() {
-        // 准备参数
-        Long id = randomLongId();
-
-        // 调用, 并断言异常
-        assertServiceException(() -> partitionBrothersService.deletePartitionBrothers(id), PARTITION_BROTHERS_NOT_EXISTS);
-    }
-
-    @Test
-    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
-    public void testGetPartitionBrothersPage() {
-       // mock 数据
-       PartitionBrothersDO dbPartitionBrothers = randomPojo(PartitionBrothersDO.class, o -> { // 等会查询到
-           o.setUserId(null);
-           o.setPartNo(null);
-           o.setPrice(null);
-           o.setHasHit(null);
-           o.setAfterHitQuota(null);
-           o.setSize(null);
-           o.setCreateTime(null);
-       });
-       partitionBrothersMapper.insert(dbPartitionBrothers);
-       // 测试 userId 不匹配
-       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setUserId(null)));
-       // 测试 partNo 不匹配
-       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setPartNo(null)));
-       // 测试 price 不匹配
-       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setPrice(null)));
-       // 测试 hasHit 不匹配
-       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setHasHit(null)));
-       // 测试 afterHitQuota 不匹配
-       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setAfterHitQuota(null)));
-       // 测试 size 不匹配
-       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setSize(null)));
-       // 测试 createTime 不匹配
-       partitionBrothersMapper.insert(cloneIgnoreId(dbPartitionBrothers, o -> o.setCreateTime(null)));
-       // 准备参数
-       PartitionBrothersPageReqVO reqVO = new PartitionBrothersPageReqVO();
-       reqVO.setUserId(null);
-       reqVO.setPartNo(null);
-       reqVO.setPrice(null);
-       reqVO.setHasHit(null);
-       reqVO.setAfterHitQuota(null);
-       reqVO.setSize(null);
-       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-
-       // 调用
-       PageResult<PartitionBrothersDO> pageResult = partitionBrothersService.getPartitionBrothersPage(reqVO);
-       // 断言
-       assertEquals(1, pageResult.getTotal());
-       assertEquals(1, pageResult.getList().size());
-       assertPojoEquals(dbPartitionBrothers, pageResult.getList().get(0));
-    }
-
-}

+ 0 - 154
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/partitionson/PartitionSonServiceImplTest.java

@@ -1,154 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.partitionson;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.newfeifan.mall.module.distri.controller.admin.partitionson.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.partitionson.PartitionSonDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.partitionson.PartitionSonMapper;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
-import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
-import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
- * {@link PartitionSonServiceImpl} 的单元测试类
- *
- * @author 非繁人
- */
-@Import(PartitionSonServiceImpl.class)
-public class PartitionSonServiceImplTest extends BaseDbUnitTest {
-
-    @Resource
-    private PartitionSonServiceImpl partitionSonService;
-
-    @Resource
-    private PartitionSonMapper partitionSonMapper;
-
-    @Test
-    public void testCreatePartitionSon_success() {
-        // 准备参数
-        PartitionSonSaveReqVO createReqVO = randomPojo(PartitionSonSaveReqVO.class).setId(null);
-
-        // 调用
-        Long partitionSonId = partitionSonService.createPartitionSon(createReqVO);
-        // 断言
-        assertNotNull(partitionSonId);
-        // 校验记录的属性是否正确
-        PartitionSonDO partitionSon = partitionSonMapper.selectById(partitionSonId);
-        assertPojoEquals(createReqVO, partitionSon, "id");
-    }
-
-    @Test
-    public void testUpdatePartitionSon_success() {
-        // mock 数据
-        PartitionSonDO dbPartitionSon = randomPojo(PartitionSonDO.class);
-        partitionSonMapper.insert(dbPartitionSon);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        PartitionSonSaveReqVO updateReqVO = randomPojo(PartitionSonSaveReqVO.class, o -> {
-            o.setId(dbPartitionSon.getId()); // 设置更新的 ID
-        });
-
-        // 调用
-        partitionSonService.updatePartitionSon(updateReqVO);
-        // 校验是否更新正确
-        PartitionSonDO partitionSon = partitionSonMapper.selectById(updateReqVO.getId()); // 获取最新的
-        assertPojoEquals(updateReqVO, partitionSon);
-    }
-
-    @Test
-    public void testUpdatePartitionSon_notExists() {
-        // 准备参数
-        PartitionSonSaveReqVO updateReqVO = randomPojo(PartitionSonSaveReqVO.class);
-
-        // 调用, 并断言异常
-        assertServiceException(() -> partitionSonService.updatePartitionSon(updateReqVO), PARTITION_SON_NOT_EXISTS);
-    }
-
-    @Test
-    public void testDeletePartitionSon_success() {
-        // mock 数据
-        PartitionSonDO dbPartitionSon = randomPojo(PartitionSonDO.class);
-        partitionSonMapper.insert(dbPartitionSon);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        Long id = dbPartitionSon.getId();
-
-        // 调用
-        partitionSonService.deletePartitionSon(id);
-       // 校验数据不存在了
-       assertNull(partitionSonMapper.selectById(id));
-    }
-
-    @Test
-    public void testDeletePartitionSon_notExists() {
-        // 准备参数
-        Long id = randomLongId();
-
-        // 调用, 并断言异常
-        assertServiceException(() -> partitionSonService.deletePartitionSon(id), PARTITION_SON_NOT_EXISTS);
-    }
-
-    @Test
-    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
-    public void testGetPartitionSonPage() {
-       // mock 数据
-       PartitionSonDO dbPartitionSon = randomPojo(PartitionSonDO.class, o -> { // 等会查询到
-           o.setUserId(null);
-           o.setPartNo(null);
-           o.setPrice(null);
-           o.setHasHit(null);
-           o.setAfterHitQuota(null);
-           o.setSize(null);
-           o.setCreateTime(null);
-       });
-       partitionSonMapper.insert(dbPartitionSon);
-       // 测试 userId 不匹配
-       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setUserId(null)));
-       // 测试 partNo 不匹配
-       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setPartNo(null)));
-       // 测试 price 不匹配
-       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setPrice(null)));
-       // 测试 hasHit 不匹配
-       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setHasHit(null)));
-       // 测试 afterHitQuota 不匹配
-       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setAfterHitQuota(null)));
-       // 测试 size 不匹配
-       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setSize(null)));
-       // 测试 createTime 不匹配
-       partitionSonMapper.insert(cloneIgnoreId(dbPartitionSon, o -> o.setCreateTime(null)));
-       // 准备参数
-       PartitionSonPageReqVO reqVO = new PartitionSonPageReqVO();
-       reqVO.setUserId(null);
-       reqVO.setPartNo(null);
-       reqVO.setPrice(null);
-       reqVO.setHasHit(null);
-       reqVO.setAfterHitQuota(null);
-       reqVO.setSize(null);
-       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-
-       // 调用
-       PageResult<PartitionSonDO> pageResult = partitionSonService.getPartitionSonPage(reqVO);
-       // 断言
-       assertEquals(1, pageResult.getTotal());
-       assertEquals(1, pageResult.getList().size());
-       assertPojoEquals(dbPartitionSon, pageResult.getList().get(0));
-    }
-
-}

+ 0 - 146
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/sharepath/SharePathServiceImplTest.java

@@ -1,146 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.sharepath;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.newfeifan.mall.module.distri.controller.admin.sharepath.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.sharepath.SharePathDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.sharepath.SharePathMapper;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
-import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
-import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
- * {@link SharePathServiceImpl} 的单元测试类
- *
- * @author 非繁人
- */
-@Import(SharePathServiceImpl.class)
-public class SharePathServiceImplTest extends BaseDbUnitTest {
-
-    @Resource
-    private SharePathServiceImpl sharePathService;
-
-    @Resource
-    private SharePathMapper sharePathMapper;
-
-    @Test
-    public void testCreateSharePath_success() {
-        // 准备参数
-        SharePathSaveReqVO createReqVO = randomPojo(SharePathSaveReqVO.class).setId(null);
-
-        // 调用
-        Long sharePathId = sharePathService.createSharePath(createReqVO);
-        // 断言
-        assertNotNull(sharePathId);
-        // 校验记录的属性是否正确
-        SharePathDO sharePath = sharePathMapper.selectById(sharePathId);
-        assertPojoEquals(createReqVO, sharePath, "id");
-    }
-
-    @Test
-    public void testUpdateSharePath_success() {
-        // mock 数据
-        SharePathDO dbSharePath = randomPojo(SharePathDO.class);
-        sharePathMapper.insert(dbSharePath);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        SharePathSaveReqVO updateReqVO = randomPojo(SharePathSaveReqVO.class, o -> {
-            o.setId(dbSharePath.getId()); // 设置更新的 ID
-        });
-
-        // 调用
-        sharePathService.updateSharePath(updateReqVO);
-        // 校验是否更新正确
-        SharePathDO sharePath = sharePathMapper.selectById(updateReqVO.getId()); // 获取最新的
-        assertPojoEquals(updateReqVO, sharePath);
-    }
-
-    @Test
-    public void testUpdateSharePath_notExists() {
-        // 准备参数
-        SharePathSaveReqVO updateReqVO = randomPojo(SharePathSaveReqVO.class);
-
-        // 调用, 并断言异常
-        assertServiceException(() -> sharePathService.updateSharePath(updateReqVO), SHARE_PATH_NOT_EXISTS);
-    }
-
-    @Test
-    public void testDeleteSharePath_success() {
-        // mock 数据
-        SharePathDO dbSharePath = randomPojo(SharePathDO.class);
-        sharePathMapper.insert(dbSharePath);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        Long id = dbSharePath.getId();
-
-        // 调用
-        sharePathService.deleteSharePath(id);
-       // 校验数据不存在了
-       assertNull(sharePathMapper.selectById(id));
-    }
-
-    @Test
-    public void testDeleteSharePath_notExists() {
-        // 准备参数
-        Long id = randomLongId();
-
-        // 调用, 并断言异常
-        assertServiceException(() -> sharePathService.deleteSharePath(id), SHARE_PATH_NOT_EXISTS);
-    }
-
-    @Test
-    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
-    public void testGetSharePathPage() {
-       // mock 数据
-       SharePathDO dbSharePath = randomPojo(SharePathDO.class, o -> { // 等会查询到
-           o.setDepth(null);
-           o.setCreateTime(null);
-           o.setAncestor(null);
-           o.setDescendant(null);
-           o.setSort(null);
-       });
-       sharePathMapper.insert(dbSharePath);
-       // 测试 depth 不匹配
-       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setDepth(null)));
-       // 测试 createTime 不匹配
-       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setCreateTime(null)));
-       // 测试 ancestor 不匹配
-       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setAncestor(null)));
-       // 测试 descendant 不匹配
-       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setDescendant(null)));
-       // 测试 sort 不匹配
-       sharePathMapper.insert(cloneIgnoreId(dbSharePath, o -> o.setSort(null)));
-       // 准备参数
-       SharePathPageReqVO reqVO = new SharePathPageReqVO();
-       reqVO.setDepth(null);
-       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-       reqVO.setAncestor(null);
-       reqVO.setDescendant(null);
-       reqVO.setSort(null);
-
-       // 调用
-       PageResult<SharePathDO> pageResult = sharePathService.getSharePathPage(reqVO);
-       // 断言
-       assertEquals(1, pageResult.getTotal());
-       assertEquals(1, pageResult.getList().size());
-       assertPojoEquals(dbSharePath, pageResult.getList().get(0));
-    }
-
-}

+ 0 - 142
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/socialstatus/SocialStatusServiceImplTest.java

@@ -1,142 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.socialstatus;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.newfeifan.mall.module.distri.controller.admin.socialstatus.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.socialstatus.SocialStatusDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.socialstatus.SocialStatusMapper;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
-import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
-import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
- * {@link SocialStatusServiceImpl} 的单元测试类
- *
- * @author 非繁人
- */
-@Import(SocialStatusServiceImpl.class)
-public class SocialStatusServiceImplTest extends BaseDbUnitTest {
-
-    @Resource
-    private SocialStatusServiceImpl socialStatusService;
-
-    @Resource
-    private SocialStatusMapper socialStatusMapper;
-
-    @Test
-    public void testCreateSocialStatus_success() {
-        // 准备参数
-        SocialStatusSaveReqVO createReqVO = randomPojo(SocialStatusSaveReqVO.class).setId(null);
-
-        // 调用
-        Long socialStatusId = socialStatusService.createSocialStatus(createReqVO);
-        // 断言
-        assertNotNull(socialStatusId);
-        // 校验记录的属性是否正确
-        SocialStatusDO socialStatus = socialStatusMapper.selectById(socialStatusId);
-        assertPojoEquals(createReqVO, socialStatus, "id");
-    }
-
-    @Test
-    public void testUpdateSocialStatus_success() {
-        // mock 数据
-        SocialStatusDO dbSocialStatus = randomPojo(SocialStatusDO.class);
-        socialStatusMapper.insert(dbSocialStatus);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        SocialStatusSaveReqVO updateReqVO = randomPojo(SocialStatusSaveReqVO.class, o -> {
-            o.setId(dbSocialStatus.getId()); // 设置更新的 ID
-        });
-
-        // 调用
-        socialStatusService.updateSocialStatus(updateReqVO);
-        // 校验是否更新正确
-        SocialStatusDO socialStatus = socialStatusMapper.selectById(updateReqVO.getId()); // 获取最新的
-        assertPojoEquals(updateReqVO, socialStatus);
-    }
-
-    @Test
-    public void testUpdateSocialStatus_notExists() {
-        // 准备参数
-        SocialStatusSaveReqVO updateReqVO = randomPojo(SocialStatusSaveReqVO.class);
-
-        // 调用, 并断言异常
-        assertServiceException(() -> socialStatusService.updateSocialStatus(updateReqVO), SOCIAL_STATUS_NOT_EXISTS);
-    }
-
-    @Test
-    public void testDeleteSocialStatus_success() {
-        // mock 数据
-        SocialStatusDO dbSocialStatus = randomPojo(SocialStatusDO.class);
-        socialStatusMapper.insert(dbSocialStatus);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        Long id = dbSocialStatus.getId();
-
-        // 调用
-        socialStatusService.deleteSocialStatus(id);
-       // 校验数据不存在了
-       assertNull(socialStatusMapper.selectById(id));
-    }
-
-    @Test
-    public void testDeleteSocialStatus_notExists() {
-        // 准备参数
-        Long id = randomLongId();
-
-        // 调用, 并断言异常
-        assertServiceException(() -> socialStatusService.deleteSocialStatus(id), SOCIAL_STATUS_NOT_EXISTS);
-    }
-
-    @Test
-    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
-    public void testGetSocialStatusPage() {
-       // mock 数据
-       SocialStatusDO dbSocialStatus = randomPojo(SocialStatusDO.class, o -> { // 等会查询到
-           o.setLevel(null);
-           o.setName(null);
-           o.setCreateTime(null);
-           o.setPoint(null);
-       });
-       socialStatusMapper.insert(dbSocialStatus);
-       // 测试 level 不匹配
-       socialStatusMapper.insert(cloneIgnoreId(dbSocialStatus, o -> o.setLevel(null)));
-       // 测试 name 不匹配
-       socialStatusMapper.insert(cloneIgnoreId(dbSocialStatus, o -> o.setName(null)));
-       // 测试 createTime 不匹配
-       socialStatusMapper.insert(cloneIgnoreId(dbSocialStatus, o -> o.setCreateTime(null)));
-       // 测试 point 不匹配
-       socialStatusMapper.insert(cloneIgnoreId(dbSocialStatus, o -> o.setPoint(null)));
-       // 准备参数
-       SocialStatusPageReqVO reqVO = new SocialStatusPageReqVO();
-       reqVO.setLevel(null);
-       reqVO.setName(null);
-       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-       reqVO.setPoint(null);
-
-       // 调用
-       PageResult<SocialStatusDO> pageResult = socialStatusService.getSocialStatusPage(reqVO);
-       // 断言
-       assertEquals(1, pageResult.getTotal());
-       assertEquals(1, pageResult.getList().size());
-       assertPojoEquals(dbSocialStatus, pageResult.getList().get(0));
-    }
-
-}

+ 0 - 134
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/source/SourceServiceImplTest.java

@@ -1,134 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.source;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.newfeifan.mall.module.distri.controller.admin.source.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.source.SourceDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.source.SourceMapper;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
-import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
-import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
- * {@link SourceServiceImpl} 的单元测试类
- *
- * @author 非繁人
- */
-@Import(SourceServiceImpl.class)
-public class SourceServiceImplTest extends BaseDbUnitTest {
-
-    @Resource
-    private SourceServiceImpl sourceService;
-
-    @Resource
-    private SourceMapper sourceMapper;
-
-    @Test
-    public void testCreateSource_success() {
-        // 准备参数
-        SourceSaveReqVO createReqVO = randomPojo(SourceSaveReqVO.class).setId(null);
-
-        // 调用
-        Long sourceId = sourceService.createSource(createReqVO);
-        // 断言
-        assertNotNull(sourceId);
-        // 校验记录的属性是否正确
-        SourceDO source = sourceMapper.selectById(sourceId);
-        assertPojoEquals(createReqVO, source, "id");
-    }
-
-    @Test
-    public void testUpdateSource_success() {
-        // mock 数据
-        SourceDO dbSource = randomPojo(SourceDO.class);
-        sourceMapper.insert(dbSource);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        SourceSaveReqVO updateReqVO = randomPojo(SourceSaveReqVO.class, o -> {
-            o.setId(dbSource.getId()); // 设置更新的 ID
-        });
-
-        // 调用
-        sourceService.updateSource(updateReqVO);
-        // 校验是否更新正确
-        SourceDO source = sourceMapper.selectById(updateReqVO.getId()); // 获取最新的
-        assertPojoEquals(updateReqVO, source);
-    }
-
-    @Test
-    public void testUpdateSource_notExists() {
-        // 准备参数
-        SourceSaveReqVO updateReqVO = randomPojo(SourceSaveReqVO.class);
-
-        // 调用, 并断言异常
-        assertServiceException(() -> sourceService.updateSource(updateReqVO), SOURCE_NOT_EXISTS);
-    }
-
-    @Test
-    public void testDeleteSource_success() {
-        // mock 数据
-        SourceDO dbSource = randomPojo(SourceDO.class);
-        sourceMapper.insert(dbSource);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        Long id = dbSource.getId();
-
-        // 调用
-        sourceService.deleteSource(id);
-       // 校验数据不存在了
-       assertNull(sourceMapper.selectById(id));
-    }
-
-    @Test
-    public void testDeleteSource_notExists() {
-        // 准备参数
-        Long id = randomLongId();
-
-        // 调用, 并断言异常
-        assertServiceException(() -> sourceService.deleteSource(id), SOURCE_NOT_EXISTS);
-    }
-
-    @Test
-    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
-    public void testGetSourcePage() {
-       // mock 数据
-       SourceDO dbSource = randomPojo(SourceDO.class, o -> { // 等会查询到
-           o.setName(null);
-           o.setCreateTime(null);
-       });
-       sourceMapper.insert(dbSource);
-       // 测试 name 不匹配
-       sourceMapper.insert(cloneIgnoreId(dbSource, o -> o.setName(null)));
-       // 测试 createTime 不匹配
-       sourceMapper.insert(cloneIgnoreId(dbSource, o -> o.setCreateTime(null)));
-       // 准备参数
-       SourcePageReqVO reqVO = new SourcePageReqVO();
-       reqVO.setName(null);
-       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-
-       // 调用
-       PageResult<SourceDO> pageResult = sourceService.getSourcePage(reqVO);
-       // 断言
-       assertEquals(1, pageResult.getTotal());
-       assertEquals(1, pageResult.getList().size());
-       assertPojoEquals(dbSource, pageResult.getList().get(0));
-    }
-
-}

+ 0 - 162
feifan-module-distri/feifan-module-distri-biz/src/test/java/cn/newfeifan/mall/module/distri/service/user/UserServiceImplTest.java

@@ -1,162 +0,0 @@
-package cn.newfeifan.mall.module.distri.service.user;
-
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.mock.mockito.MockBean;
-
-import javax.annotation.Resource;
-
-import cn.newfeifan.mall.framework.test.core.ut.BaseDbUnitTest;
-
-import cn.newfeifan.mall.module.distri.controller.admin.user.vo.*;
-import cn.newfeifan.mall.module.distri.dal.dataobject.user.UserDO;
-import cn.newfeifan.mall.module.distri.dal.mysql.user.UserMapper;
-import cn.newfeifan.mall.framework.common.pojo.PageResult;
-
-import javax.annotation.Resource;
-import org.springframework.context.annotation.Import;
-import java.util.*;
-import java.time.LocalDateTime;
-
-import static cn.hutool.core.util.RandomUtil.*;
-import static cn.newfeifan.mall.module.distri.enums.ErrorCodeConstants.*;
-import static cn.newfeifan.mall.framework.test.core.util.AssertUtils.*;
-import static cn.newfeifan.mall.framework.test.core.util.RandomUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.LocalDateTimeUtils.*;
-import static cn.newfeifan.mall.framework.common.util.object.ObjectUtils.*;
-import static cn.newfeifan.mall.framework.common.util.date.DateUtils.*;
-import static org.junit.jupiter.api.Assertions.*;
-import static org.mockito.Mockito.*;
-
-/**
- * {@link UserServiceImpl} 的单元测试类
- *
- * @author 非繁人
- */
-@Import(UserServiceImpl.class)
-public class UserServiceImplTest extends BaseDbUnitTest {
-
-    @Resource
-    private UserServiceImpl userService;
-
-    @Resource
-    private UserMapper userMapper;
-
-    @Test
-    public void testCreateUser_success() {
-        // 准备参数
-        UserSaveReqVO createReqVO = randomPojo(UserSaveReqVO.class).setId(null);
-
-        // 调用
-        Long userId = userService.createUser(createReqVO);
-        // 断言
-        assertNotNull(userId);
-        // 校验记录的属性是否正确
-        UserDO user = userMapper.selectById(userId);
-        assertPojoEquals(createReqVO, user, "id");
-    }
-
-    @Test
-    public void testUpdateUser_success() {
-        // mock 数据
-        UserDO dbUser = randomPojo(UserDO.class);
-        userMapper.insert(dbUser);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        UserSaveReqVO updateReqVO = randomPojo(UserSaveReqVO.class, o -> {
-            o.setId(dbUser.getId()); // 设置更新的 ID
-        });
-
-        // 调用
-        userService.updateUser(updateReqVO);
-        // 校验是否更新正确
-        UserDO user = userMapper.selectById(updateReqVO.getId()); // 获取最新的
-        assertPojoEquals(updateReqVO, user);
-    }
-
-    @Test
-    public void testUpdateUser_notExists() {
-        // 准备参数
-        UserSaveReqVO updateReqVO = randomPojo(UserSaveReqVO.class);
-
-        // 调用, 并断言异常
-        assertServiceException(() -> userService.updateUser(updateReqVO), USER_NOT_EXISTS);
-    }
-
-    @Test
-    public void testDeleteUser_success() {
-        // mock 数据
-        UserDO dbUser = randomPojo(UserDO.class);
-        userMapper.insert(dbUser);// @Sql: 先插入出一条存在的数据
-        // 准备参数
-        Long id = dbUser.getId();
-
-        // 调用
-        userService.deleteUser(id);
-       // 校验数据不存在了
-       assertNull(userMapper.selectById(id));
-    }
-
-    @Test
-    public void testDeleteUser_notExists() {
-        // 准备参数
-        Long id = randomLongId();
-
-        // 调用, 并断言异常
-        assertServiceException(() -> userService.deleteUser(id), USER_NOT_EXISTS);
-    }
-
-    @Test
-    @Disabled  // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
-    public void testGetUserPage() {
-       // mock 数据
-       UserDO dbUser = randomPojo(UserDO.class, o -> { // 等会查询到
-           o.setCreateTime(null);
-           o.setUserId(null);
-           o.setName(null);
-           o.setMobile(null);
-           o.setSource(null);
-           o.setIntegralId(null);
-           o.setSocialStatus(null);
-           o.setSocialStatusPoint(null);
-           o.setCategoryId(null);
-       });
-       userMapper.insert(dbUser);
-       // 测试 createTime 不匹配
-       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setCreateTime(null)));
-       // 测试 userId 不匹配
-       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setUserId(null)));
-       // 测试 name 不匹配
-       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setName(null)));
-       // 测试 mobile 不匹配
-       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setMobile(null)));
-       // 测试 source 不匹配
-       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setSource(null)));
-       // 测试 integralId 不匹配
-       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setIntegralId(null)));
-       // 测试 socialStatus 不匹配
-       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setSocialStatus(null)));
-       // 测试 socialStatusPoint 不匹配
-       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setSocialStatusPoint(null)));
-       // 测试 categoryId 不匹配
-       userMapper.insert(cloneIgnoreId(dbUser, o -> o.setCategoryId(null)));
-       // 准备参数
-       UserPageReqVO reqVO = new UserPageReqVO();
-       reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
-       reqVO.setUserId(null);
-       reqVO.setName(null);
-       reqVO.setMobile(null);
-       reqVO.setSource(null);
-       reqVO.setIntegralId(null);
-       reqVO.setSocialStatus(null);
-       reqVO.setSocialStatusPoint(null);
-       reqVO.setCategoryId(null);
-
-       // 调用
-       PageResult<UserDO> pageResult = userService.getUserPage(reqVO);
-       // 断言
-       assertEquals(1, pageResult.getTotal());
-       assertEquals(1, pageResult.getList().size());
-       assertPojoEquals(dbUser, pageResult.getList().get(0));
-    }
-
-}

+ 4 - 1
feifan-server/src/main/java/cn/newfeifan/mall/server/FeifanServerApplication.java

@@ -13,7 +13,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
  * @author 非繁源码
  * @author 非繁源码
  */
  */
 @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${feifan.info.base-package}
 @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${feifan.info.base-package}
-@SpringBootApplication(scanBasePackages = {"${feifan.info.base-package}.server","${feifan.info.base-package}.module","${feifan.info.base-package}.sale"})
+@SpringBootApplication(scanBasePackages = {"${feifan.info.base-package}.server",
+        "${feifan.info.base-package}.module",
+        "${feifan.info.base-package}.sale",
+        "cn.newfeifan.mall.module.distri" })
 public class FeifanServerApplication {
 public class FeifanServerApplication {
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {