You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2026/02/11 05:19:19 UTC

(shardingsphere) branch master updated: Refactor DistSQLProxyBackendHandlerFactoryTest (#38001)

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 6b61cc4064d Refactor DistSQLProxyBackendHandlerFactoryTest (#38001)
6b61cc4064d is described below

commit 6b61cc4064d3b4c795e20ac69035f4597b806cd6
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Wed Feb 11 13:19:12 2026 +0800

    Refactor DistSQLProxyBackendHandlerFactoryTest (#38001)
---
 .../handler/distsql/DistSQLProxyBackendHandlerFactoryTest.java    | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactoryTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactoryTest.java
index 87193a4a9eb..8d8e605e172 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactoryTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/DistSQLProxyBackendHandlerFactoryTest.java
@@ -103,7 +103,7 @@ class DistSQLProxyBackendHandlerFactoryTest {
     @ParameterizedTest(name = "{0}")
     @MethodSource("newInstanceSupportedStatements")
     void assertNewInstanceWithSupportedStatements(final String caseName, final Class<? extends DistSQLStatement> statementClass, final Class<?> expectedHandlerClass) {
-        assertThat(DistSQLProxyBackendHandlerFactory.newInstance(mockDistSQLStatement(statementClass), mock(), connectionSession), isA(expectedHandlerClass));
+        assertThat(DistSQLProxyBackendHandlerFactory.newInstance(mock(statementClass, RETURNS_DEEP_STUBS), mock(), connectionSession), isA(expectedHandlerClass));
     }
     
     @Test
@@ -259,12 +259,6 @@ class DistSQLProxyBackendHandlerFactoryTest {
                 () -> new DistSQLUpdateProxyBackendHandler(mock(AlterReadwriteSplittingRuleStatement.class, RETURNS_DEEP_STUBS), mock(), connectionSession, contextManager).execute());
     }
     
-    private DistSQLStatement mockDistSQLStatement(final Class<? extends DistSQLStatement> statementClass) {
-        DistSQLStatement result = mock(statementClass, RETURNS_DEEP_STUBS);
-        when(result.getAttributes()).thenReturn(new SQLStatementAttributes());
-        return result;
-    }
-    
     private ShardingSphereDatabase mockDatabaseWithRule() {
         ShardingSphereDatabase result = mock(ShardingSphereDatabase.class, RETURNS_DEEP_STUBS);
         when(result.getName()).thenReturn("foo_db");