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