diff --git a/src/test-integration/java/cn/iocoder/dashboard/BaseDbAndRedisIntegrationTest.java b/src/test-integration/java/cn/iocoder/dashboard/BaseDbAndRedisIntegrationTest.java index 198885ac1..bb0b4a219 100644 --- a/src/test-integration/java/cn/iocoder/dashboard/BaseDbAndRedisIntegrationTest.java +++ b/src/test-integration/java/cn/iocoder/dashboard/BaseDbAndRedisIntegrationTest.java @@ -3,9 +3,7 @@ package cn.iocoder.dashboard; import cn.iocoder.dashboard.framework.datasource.config.DataSourceConfiguration; import cn.iocoder.dashboard.framework.mybatis.config.MybatisConfiguration; import cn.iocoder.dashboard.framework.redis.config.RedisConfig; -import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration; -import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.druid.DruidDynamicDataSourceConfiguration; import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration; import org.redisson.spring.starter.RedissonAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; @@ -21,16 +19,14 @@ public class BaseDbAndRedisIntegrationTest { @Import({ // DB 配置类 + DynamicDataSourceAutoConfiguration.class, // Dynamic Datasource 配置类 DataSourceConfiguration.class, // 自己的 DB 配置类 DataSourceAutoConfiguration.class, // Spring DB 自动配置类 DataSourceTransactionManagerAutoConfiguration.class, // Spring 事务自动配置类 - DruidDataSourceAutoConfigure.class, // Druid 自动配置类 // MyBatis 配置类 MybatisConfiguration.class, // 自己的 MyBatis 配置类 MybatisPlusAutoConfiguration.class, // MyBatis 的自动配置类 - // Dynamic Datasource 配置后类 - DynamicDataSourceAutoConfiguration.class, // - DruidDynamicDataSourceConfiguration.class, // + // Redis 配置类 RedisAutoConfiguration.class, // Spring Redis 自动配置类 RedisConfig.class, // 自己的 Redis 配置类 diff --git a/src/test-integration/resources/application-integration-test.yaml b/src/test-integration/resources/application-integration-test.yaml index 9c3f718a5..a248134d2 100644 --- a/src/test-integration/resources/application-integration-test.yaml +++ b/src/test-integration/resources/application-integration-test.yaml @@ -11,6 +11,24 @@ spring: exclude: - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 datasource: + druid: # Druid 【监控】相关的全局配置 + web-stat-filter: + enabled: true + stat-view-servlet: + enabled: true + allow: # 设置白名单,不填则允许所有访问 + url-pattern: /druid/* + login-username: # 控制台管理用户名和密码 + login-password: + filter: + stat: + enabled: true + log-slow-sql: true # 慢 SQL 记录 + slow-sql-millis: 100 + merge-sql: true + wall: + config: + multi-statement-allow: true dynamic: # 多数据源配置 druid: # Druid 【连接池】相关的全局配置 initial-size: 5 # 初始连接数