diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java index fc29a1b78..7ff1c4a11 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java @@ -1,7 +1,6 @@ package cn.iocoder.yudao.framework.test.core.ut; import cn.iocoder.yudao.framework.datasource.config.YudaoDataSourceAutoConfiguration; -import cn.iocoder.yudao.framework.mybatis.config.MybatisPlusJoinConfiguration; import cn.iocoder.yudao.framework.mybatis.config.YudaoMybatisAutoConfiguration; import cn.iocoder.yudao.framework.test.config.SqlInitializationTestConfiguration; import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; @@ -37,7 +36,6 @@ public class BaseDbUnitTest { // MyBatis 配置类 YudaoMybatisAutoConfiguration.class, // 自己的 MyBatis 配置类 MybatisPlusAutoConfiguration.class, // MyBatis 的自动配置类 - MybatisPlusJoinConfiguration.class, // MyBatis 的自动配置类 // TODO @升平:看看有没可能去掉下面两个类 JoinInterceptor.class, // MyBatis 的Join配置类 JoinInterceptorConfig.class, // MyBatis 的Join配置类 diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java index 46d096496..43edc3b59 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImplTest.java @@ -776,7 +776,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { @Test public void testSelectUserIncludeDept_success() { - // 需设置 application-unit-test.yaml 文件中 spring.main.lazy-initialization: true + // 需设置 application-unit-test.yaml 文件中 spring.main.lazy-initialization: false // 准备部门数据 DeptDO dept = new DeptDO(); @@ -798,6 +798,7 @@ public class AdminUserServiceImplTest extends BaseDbUnitTest { // 断言 AdminUserDO user = Joins.of(AdminUserDO.class) .leftJoin(DeptDO.class, DeptDO::getId, AdminUserDO::getDeptId) + .oneToOneSelect(AdminUserDO::getDept, DeptDO.class) .end() .eq(AdminUserDO::getId, userId) .joinGetOne(AdminUserDO.class);