blob: 45122fa0825f15a8437230703720a61e8bd1df1c [file] [log] [blame]
22301080fd521b02025-04-24 23:22:49 +08001# 测试环境配置
2spring:
3 application:
4 name: PTPlatform-test # 区分测试环境
5
6 # 数据源配置 (H2 内存数据库)
7 datasource:
8 url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;MODE=MYSQL # 模拟MySQL语法
9 driver-class-name: org.h2.Driver
10 username: sa
11 password:
12
13
14 # JPA/Hibernate 配置
15 jpa:
16 hibernate:
17 ddl-auto: update # 自动更新表结构
18 show-sql: true # 显示SQL日志
19 properties:
20 hibernate:
21 dialect: org.hibernate.dialect.H2Dialect
22 format_sql: true
23
24 # 关闭开发工具(测试环境不需要热部署)
25 devtools:
26 restart:
27 enabled: false
28 sql:
29 init:
30 platform: h2
31
32# MyBatis-Plus 测试配置
33mybatis-plus:
34 configuration:
35 log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 输出SQL日志
36 mapper-locations: classpath:/mapper/*.xml
37 type-aliases-package: com.example.demo.model
38
39# 测试专用端口
40server:
41 port: 0 # 随机端口,避免冲突