Commit e26bd20a5b121f729cc42e5aa6168806a73f394f

Authored by dhb52
1 parent 7e312aae

feat:添加测试配置及excel依赖

yudao-module-crm/yudao-module-crm-biz/pom.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2   -<project xmlns="http://maven.apache.org/POM/4.0.0"
3   - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 +<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 + xmlns="http://maven.apache.org/POM/4.0.0"
4 4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5 5 <parent>
6 6 <groupId>cn.iocoder.boot</groupId>
... ... @@ -22,6 +22,11 @@
22 22 <artifactId>yudao-module-system-api</artifactId>
23 23 <version>${revision}</version>
24 24 </dependency>
  25 + <dependency>
  26 + <groupId>cn.iocoder.boot</groupId>
  27 + <artifactId>yudao-module-crm-api</artifactId>
  28 + <version>${revision}</version>
  29 + </dependency>
25 30  
26 31 <!-- 业务组件 -->
27 32 <dependency>
... ... @@ -46,6 +51,12 @@
46 51 <artifactId>yudao-spring-boot-starter-mybatis</artifactId>
47 52 </dependency>
48 53  
  54 + <!-- 工具类相关 -->
  55 + <dependency>
  56 + <groupId>cn.iocoder.boot</groupId>
  57 + <artifactId>yudao-spring-boot-starter-excel</artifactId>
  58 + </dependency>
  59 +
49 60 <!-- Test 测试相关 -->
50 61 <dependency>
51 62 <groupId>cn.iocoder.boot</groupId>
... ...
yudao-module-crm/yudao-module-crm-biz/src/test/resources/application-unit-test.yaml 0 → 100644
  1 +spring:
  2 + main:
  3 + lazy-initialization: true # 开启懒加载,加快速度
  4 + banner-mode: off # 单元测试,禁用 Banner
  5 +
  6 +--- #################### 数据库相关配置 ####################
  7 +
  8 +spring:
  9 + # 数据源配置项
  10 + datasource:
  11 + name: ruoyi-vue-pro
  12 + url: jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false;NON_KEYWORDS=value; # MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写
  13 + driver-class-name: org.h2.Driver
  14 + username: sa
  15 + password:
  16 + druid:
  17 + async-init: true # 单元测试,异步初始化 Druid 连接池,提升启动速度
  18 + initial-size: 1 # 单元测试,配置为 1,提升启动速度
  19 + sql:
  20 + init:
  21 + schema-locations: classpath:/sql/create_tables.sql
  22 +
  23 + # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
  24 + redis:
  25 + host: 127.0.0.1 # 地址
  26 + port: 16379 # 端口(单元测试,使用 16379 端口)
  27 + database: 0 # 数据库索引
  28 +
  29 +mybatis-plus:
  30 + lazy-initialization: true # 单元测试,设置 MyBatis Mapper 延迟加载,加速每个单元测试
  31 + type-aliases-package: ${yudao.info.base-package}.module.*.dal.dataobject
  32 +
  33 +--- #################### 定时任务相关配置 ####################
  34 +
  35 +--- #################### 配置中心相关配置 ####################
  36 +
  37 +--- #################### 服务保障相关配置 ####################
  38 +
  39 +# Lock4j 配置项(单元测试,禁用 Lock4j)
  40 +
  41 +# Resilience4j 配置项
  42 +
  43 +--- #################### 监控相关配置 ####################
  44 +
  45 +--- #################### 芋道相关配置 ####################
  46 +
  47 +# 芋道配置项,设置当前项目所有自定义的配置
  48 +yudao:
  49 + info:
  50 + base-package: cn.iocoder.yudao
... ...
yudao-module-crm/yudao-module-crm-biz/src/test/resources/logback.xml 0 → 100644
  1 +<configuration>
  2 + <!-- 引用 Spring Boot 的 logback 基础配置 -->
  3 + <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
  4 +</configuration>
... ...