diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 3570b6970..01672b9c0 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -47,7 +47,7 @@ 2.7.15 0.33.0 - 8.0.1.RELEASE + 7.2.11.RELEASE 1.0.13 4.11.0 diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbAndRedisUnitTest.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbAndRedisUnitTest.java index f5de235f6..48a179006 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbAndRedisUnitTest.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbAndRedisUnitTest.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.test.config.SqlInitializationTestConfiguration import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration; import org.redisson.spring.starter.RedissonAutoConfiguration; +import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; @@ -40,8 +41,8 @@ public class BaseDbAndRedisUnitTest { // Redis 配置类 RedisTestConfiguration.class, // Redis 测试配置类,用于启动 RedisServer -// RedisAutoConfiguration.class, // Spring Redis 自动配置类 YudaoRedisAutoConfiguration.class, // 自己的 Redis 配置类 + RedisAutoConfiguration.class, // Spring Redis 自动配置类 RedissonAutoConfiguration.class, // Redisson 自动高配置类 }) public static class Application { diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImplTest.java index d5bc5c5a6..1c34679a3 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImplTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/db/DataSourceConfigServiceImplTest.java @@ -9,7 +9,7 @@ import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigSaveReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO; import cn.iocoder.yudao.module.infra.dal.mysql.db.DataSourceConfigMapper; -import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourceProperty; +import com.baomidou.dynamic.datasource.creator.DataSourceProperty; import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -61,8 +61,11 @@ public class DataSourceConfigServiceImplTest extends BaseDbUnitTest { // mock DynamicDataSourceProperties when(dynamicDataSourceProperties.getPrimary()).thenReturn("primary"); - when(dynamicDataSourceProperties.getDatasource()).thenReturn(MapUtil.of("primary", - new DataSourceProperty().setUrl("http://localhost:3306").setUsername("yunai").setPassword("tudou"))); + DataSourceProperty dataSourceProperty = new DataSourceProperty(); + dataSourceProperty.setUrl("http://localhost:3306"); + dataSourceProperty.setUsername("yunai"); + dataSourceProperty.setPassword("tudou"); + when(dynamicDataSourceProperties.getDatasource()).thenReturn(MapUtil.of("primary", dataSourceProperty)); } @Test