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 51e5f63a2bc Refactor UnsupportedOperationConnectionTest (#31723)
51e5f63a2bc is described below
commit 51e5f63a2bc6736ebec86c86233bb7007bde2a14
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Jun 16 23:24:50 2024 +0800
Refactor UnsupportedOperationConnectionTest (#31723)
---
.../jdbc/unsupported/UnsupportedOperationConnectionTest.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git
a/jdbc/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationConnectionTest.java
b/jdbc/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationConnectionTest.java
index b4fd5c0dbc5..75c3193bdef 100644
---
a/jdbc/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationConnectionTest.java
+++
b/jdbc/src/test/java/org/apache/shardingsphere/driver/jdbc/unsupported/UnsupportedOperationConnectionTest.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.driver.jdbc.unsupported;
+import org.apache.shardingsphere.authority.rule.AuthorityRule;
import
org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection;
import org.apache.shardingsphere.infra.database.core.DefaultDatabase;
import
org.apache.shardingsphere.infra.exception.generic.UnsupportedSQLOperationException;
@@ -24,6 +25,7 @@ import
org.apache.shardingsphere.infra.metadata.database.rule.RuleMetaData;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.traffic.rule.TrafficRule;
import org.apache.shardingsphere.transaction.rule.TransactionRule;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.sql.ResultSet;
@@ -38,12 +40,13 @@ import static org.mockito.Mockito.when;
class UnsupportedOperationConnectionTest {
- private final ShardingSphereConnection shardingSphereConnection;
+ private ShardingSphereConnection shardingSphereConnection;
- UnsupportedOperationConnectionTest() {
+ @BeforeEach
+ void setUp() {
ContextManager contextManager = mock(ContextManager.class,
RETURNS_DEEP_STUBS);
when(contextManager.getMetaDataContexts().getMetaData().getGlobalRuleMetaData()).thenReturn(
- new RuleMetaData(Arrays.asList(mock(TransactionRule.class,
RETURNS_DEEP_STUBS), mock(TrafficRule.class))));
+ new RuleMetaData(Arrays.asList(mock(AuthorityRule.class),
mock(TransactionRule.class, RETURNS_DEEP_STUBS), mock(TrafficRule.class))));
shardingSphereConnection = new
ShardingSphereConnection(DefaultDatabase.LOGIC_NAME, contextManager);
}