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 828dd3d4af3 Fix test cases on ShardingSphereConnectionTest (#31722)
828dd3d4af3 is described below
commit 828dd3d4af38fcaeecd90234f06d0a448f2eced9
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Jun 16 23:17:55 2024 +0800
Fix test cases on ShardingSphereConnectionTest (#31722)
---
.../connection/ShardingSphereConnectionTest.java | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git
a/jdbc/src/test/java/org/apache/shardingsphere/driver/jdbc/core/connection/ShardingSphereConnectionTest.java
b/jdbc/src/test/java/org/apache/shardingsphere/driver/jdbc/core/connection/ShardingSphereConnectionTest.java
index 0a25edb3b37..8cec2ec6ab0 100644
---
a/jdbc/src/test/java/org/apache/shardingsphere/driver/jdbc/core/connection/ShardingSphereConnectionTest.java
+++
b/jdbc/src/test/java/org/apache/shardingsphere/driver/jdbc/core/connection/ShardingSphereConnectionTest.java
@@ -36,7 +36,6 @@ import org.junit.jupiter.api.Test;
import org.mockito.internal.configuration.plugins.Plugins;
import javax.sql.DataSource;
-import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Arrays;
@@ -46,7 +45,6 @@ import java.util.Properties;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
@@ -193,26 +191,6 @@ class ShardingSphereConnectionTest {
}
}
- @Test
- void assertCreateArrayOf() throws SQLException {
- Connection physicalConnection = mock(Connection.class);
- try (ShardingSphereConnection connection = new
ShardingSphereConnection(DefaultDatabase.LOGIC_NAME,
mockContextManager(physicalConnection))) {
- connection.getDatabaseConnectionManager().getConnections("ds", 0,
1, ConnectionMode.MEMORY_STRICTLY);
- assertNull(connection.createArrayOf("int", null));
- }
- verify(physicalConnection).createArrayOf("int", null);
- }
-
- @Test
- void assertPrepareCall() throws SQLException {
- CallableStatement expected = mock(CallableStatement.class);
- Connection physicalConnection = mock(Connection.class);
- when(physicalConnection.prepareCall("")).thenReturn(expected);
- try (ShardingSphereConnection connection = new
ShardingSphereConnection(DefaultDatabase.LOGIC_NAME,
mockContextManager(physicalConnection))) {
- assertThat(connection.prepareCall(""), is(expected));
- }
- }
-
@Test
void assertClose() throws SQLException {
try (ShardingSphereConnection connection = new
ShardingSphereConnection(DefaultDatabase.LOGIC_NAME, mockContextManager())) {