mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
调整Mybaits Plus Join的SQL注入器到YudaoMybatisAutoConfiguration
This commit is contained in:
parent
7e0fb6cb56
commit
95159b0257
@ -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配置类
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user