集成 Spring Boot Admin 监控服务端及客户端依赖,并新增 AdminServerConfig 配置类启用应用监控。
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.youlai.boot.plugin.mybatis;
|
||||
package com.youlai.boot.config;
|
||||
|
||||
import com.youlai.boot.security.model.RoleDataScope;
|
||||
import com.youlai.boot.security.model.SysUserDetails;
|
||||
@@ -115,7 +115,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 返回原始where
|
||||
assertThat(result).isSameAs(where);
|
||||
@@ -134,7 +134,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 添加部门过滤条件
|
||||
assertThat(result).isNotNull();
|
||||
@@ -154,7 +154,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 添加用户过滤条件
|
||||
assertThat(result).isNotNull();
|
||||
@@ -174,7 +174,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 添加自定义部门IN条件
|
||||
assertThat(result).isNotNull();
|
||||
@@ -197,7 +197,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 添加1=0条件(无权限)
|
||||
assertThat(result).isNotNull();
|
||||
@@ -217,7 +217,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 添加子查询条件
|
||||
assertThat(result).isNotNull();
|
||||
@@ -250,7 +250,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 返回原始where,不添加过滤条件
|
||||
assertThat(result).isSameAs(where);
|
||||
@@ -273,7 +273,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 生成OR连接的合并条件
|
||||
assertThat(result).isNotNull();
|
||||
@@ -298,7 +298,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 生成OR连接的IN条件
|
||||
assertThat(result).isNotNull();
|
||||
@@ -319,7 +319,7 @@ class MyDataPermissionHandlerTest {
|
||||
|
||||
// when
|
||||
Expression result = handler.getSqlSegment(where,
|
||||
"com.youlai.boot.plugin.mybatis.TestDataPermissionMapper.selectList");
|
||||
"com.youlai.boot.config.TestDataPermissionMapper.selectList");
|
||||
|
||||
// then: 结果应该包含原始where和数据权限条件
|
||||
assertThat(result).isInstanceOf(AndExpression.class);
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.youlai.boot.plugin.mybatis;
|
||||
package com.youlai.boot.config;
|
||||
|
||||
import com.youlai.boot.common.annotation.DataPermission;
|
||||
|
||||
Reference in New Issue
Block a user