spring: datasource: # Defaults to in-memory H2. CI or a developer with MySQL can point TEST_DATASOURCE_* at a real # MySQL schema: several migrations use MySQL-only syntax (for example V77) that H2 cannot parse. url: ${TEST_DATASOURCE_URL:jdbc:h2:mem:talent_card;MODE=MySQL;DATABASE_TO_LOWER=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE} username: ${TEST_DATASOURCE_USERNAME:sa} password: ${TEST_DATASOURCE_PASSWORD:} driver-class-name: ${TEST_DATASOURCE_DRIVER:org.h2.Driver} hikari: # 空闲上下文只留 1 条连接,按需再涨到 maximum-pool-size(默认 10)。 # # 每个 @SpringBootTest 的上下文都缓存到整个 JVM 结束、各自持有一个连接池,而 Hikari 的 # minimum-idle 默认等于 maximum-pool-size(10),启动时就把 10 条建满——一次全量跑下来会累积 # 十几个上下文,测试库那个 8.0 实例的 max_connections=151 就被吃光,后加载的上下文直接以 # 「Too many connections / SQL State 08004」失败(2026-10-12 实测:一次全量里建了 15 个上下文, # 150 条空闲连接)。连接池语义本身不变,只是不让**空闲**的上下文各占 10 条。 minimum-idle: 1 flyway: enabled: true jpa: hibernate: ddl-auto: validate app: payment: huifu: # The provider integration stays off in tests: no outbound Huifu calls, and readiness only # enforces the local onboarding and bank-card preconditions. enabled: false merchant-capability-required: false # 对账补单的定时任务在测试里不触发:用例自己直接调用查询与收敛服务(见 PaymentSettlementTests、 # PendingPaymentConfirmationTests),避免后台任务在共享测试库上改动别的用例正在断言的流水与问题记录。 reconciliation: enabled: false # 悬账自动退款的定时任务在测试里不触发:用例自己直接调用 retry(...),避免后台任务在共享测试库上 # 改动别的用例正在断言的问题记录与退款记录。 stranded-refund: enabled: false merchant: auto-withdrawal: # 自动提现的定时任务在测试里不触发:用例自己直接调用汇总/结果处理服务,避免后台任务在共享测试库上 # 改动别的用例正在断言的记录。 enabled: false result-check-enabled: false bank-branch-directory: # No test reads the branch directory, and importing bank-branches.xlsx inserts ~100k rows in # batches, which adds minutes to the first application context of every fresh schema (and has # been observed to stall). Production keeps the default, so a real deployment still imports it. import-enabled: false