application-unit-test.yaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. spring:
  2. main:
  3. lazy-initialization: true
  4. # 去除的自动配置项
  5. autoconfigure:
  6. exclude:
  7. - org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration # 单元测试,禁用 SpringSecurity
  8. - org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration # 单元测试,禁用 SpringSecurity
  9. - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 单元测试,禁用 Quartz
  10. - com.baomidou.lock.spring.boot.autoconfigure.LockAutoConfiguration # 单元测试,禁用 Lock4j 分布式锁
  11. --- #################### 数据库相关配置 ####################
  12. spring:
  13. # 数据源配置项
  14. datasource:
  15. name: ruoyi-vue-pro
  16. url: jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false; # MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写
  17. driver-class-name: org.h2.Driver
  18. username: sa
  19. password:
  20. schema: classpath:sql/create_tables.sql # MySQL 转 H2 的语句,使用 https://www.jooq.org/translate/ 工具
  21. # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
  22. redis:
  23. host: 127.0.0.1 # 地址
  24. port: 6379 # 端口
  25. database: 0 # 数据库索引
  26. --- #################### 定时任务相关配置 ####################
  27. # Quartz 配置项,对应 QuartzProperties 配置类(单元测试,禁用 Quartz)
  28. --- #################### 配置中心相关配置 ####################
  29. # Apollo 配置中心
  30. apollo:
  31. bootstrap:
  32. enabled: false # 单元测试,禁用配置中心
  33. --- #################### 服务保障相关配置 ####################
  34. # Lock4j 配置项(单元测试,禁用 Lock4j)
  35. # Resilience4j 配置项
  36. resilience4j:
  37. ratelimiter:
  38. instances:
  39. backendA:
  40. limit-for-period: 1 # 每个周期内,允许的请求数。默认为 50
  41. limit-refresh-period: 60s # 每个周期的时长,单位:微秒。默认为 500
  42. timeout-duration: 1s # 被限流时,阻塞等待的时长,单位:微秒。默认为 5s
  43. register-health-indicator: true # 是否注册到健康监测
  44. --- #################### 监控相关配置 ####################
  45. # Actuator 监控端点的配置项
  46. management:
  47. endpoints:
  48. enabled-by-default: false
  49. # Spring Boot Admin 配置项
  50. spring:
  51. boot:
  52. admin:
  53. # Spring Boot Admin Client 客户端的相关配置
  54. client:
  55. enabled: false
  56. # Spring Boot Admin Server 服务端的相关配置
  57. context-path: /admin # 配置 Spring
  58. # 日志文件配置
  59. logging:
  60. file:
  61. path: ${user.home}/logs/ # 日志文件的路径
  62. --- #################### 芋道相关配置 ####################
  63. # 芋道配置项,设置当前项目所有自定义的配置
  64. yudao:
  65. info:
  66. version: 1.0.0
  67. base-package: cn.iocoder.dashboard
  68. web:
  69. api-prefix: /api
  70. controller-package: ${yudao.info.base-package}
  71. security:
  72. token-header: Authorization
  73. token-secret: abcdefghijklmnopqrstuvwxyz
  74. token-timeout: 1d
  75. session-timeout: 30m
  76. mock-enable: true
  77. mock-secret: test
  78. swagger:
  79. enable: false # 单元测试,禁用 Swagger
  80. captcha:
  81. timeout: 5m
  82. width: 160
  83. height: 60
  84. file:
  85. base-path: http://127.0.0.1:${server.port}/${yudao.web.api-prefix}/file/get/
  86. codegen:
  87. base-package: ${yudao.info.base-package}.modules
  88. db-schemas: ${spring.datasource.name}
  89. xss:
  90. enable: false
  91. exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
  92. - ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
  93. - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求