This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new be626d91fa6 Refactor ShowTablesExecutorTest (#31708)
be626d91fa6 is described below
commit be626d91fa69d7887ced776debc30804372468d7
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Jun 15 15:51:30 2024 +0800
Refactor ShowTablesExecutorTest (#31708)
* Refactor DriverDatabaseConnectionManagerTest
* Refactor ShowTablesExecutorTest
---
.../mysql/handler/admin/executor/ShowTablesExecutorTest.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutorTest.java
b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutorTest.java
index da44464a64e..128370e25c8 100644
---
a/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutorTest.java
+++
b/proxy/backend/type/mysql/src/test/java/org/apache/shardingsphere/proxy/backend/mysql/handler/admin/executor/ShowTablesExecutorTest.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor;
+import org.apache.shardingsphere.authority.rule.AuthorityRule;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import
org.apache.shardingsphere.infra.executor.sql.execute.result.query.QueryResultMetaData;
@@ -193,8 +194,8 @@ class ShowTablesExecutorTest {
ShardingSphereDataPersistService shardingSphereDataPersistService =
mock(ShardingSphereDataPersistService.class);
when(shardingSphereDataPersistService.load(any())).thenReturn(Optional.empty());
when(metaDataPersistService.getShardingSphereDataPersistService()).thenReturn(shardingSphereDataPersistService);
- MetaDataContexts metaDataContexts =
MetaDataContextsFactory.create(metaDataPersistService,
- new ShardingSphereMetaData(databases,
mock(ResourceMetaData.class), mock(RuleMetaData.class), new
ConfigurationProperties(new Properties())));
+ MetaDataContexts metaDataContexts =
MetaDataContextsFactory.create(metaDataPersistService, new
ShardingSphereMetaData(databases, mock(ResourceMetaData.class),
+ new
RuleMetaData(Collections.singleton(mock(AuthorityRule.class))), new
ConfigurationProperties(new Properties())));
ContextManager result = mock(ContextManager.class, RETURNS_DEEP_STUBS);
when(result.getMetaDataContexts()).thenReturn(metaDataContexts);
when(result.getDatabase("db_0")).thenReturn(databases.get("db_0"));
@@ -220,7 +221,7 @@ class ShowTablesExecutorTest {
}
private ConnectionSession mockConnectionSession() {
- ConnectionSession result = mock(ConnectionSession.class);
+ ConnectionSession result = mock(ConnectionSession.class,
RETURNS_DEEP_STUBS);
when(result.getDatabaseName()).thenReturn(String.format(DATABASE_PATTERN, 0));
return result;
}