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 15b967b5b35 Refactor ProxySQLExecutorTest (#38060)
15b967b5b35 is described below

commit 15b967b5b35b19b964be041d1f7a25ee9f9876f6
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Feb 16 15:43:07 2026 +0800

    Refactor ProxySQLExecutorTest (#38060)
---
 .../proxy/backend/connector/ProxySQLExecutorTest.java         | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
 
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
index 7fbfa9a099a..1720c6047f9 100644
--- 
a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
+++ 
b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/connector/ProxySQLExecutorTest.java
@@ -265,18 +265,17 @@ class ProxySQLExecutorTest {
         ExecutionGroupContext<JDBCExecutionUnit> jdbcExecutionGroupContext = 
mock(ExecutionGroupContext.class);
         try (
                 MockedConstruction<DriverExecutionPrepareEngine> ignored = 
mockConstruction(DriverExecutionPrepareEngine.class,
-                        (mock, context) -> when(mock.prepare(anyString(), 
eq(executionContext), anyCollection(), any(ExecutionGroupReportContext.class)))
-                                .thenReturn(jdbcExecutionGroupContext))) {
+                        (mock, context) -> when(mock.prepare(anyString(), 
eq(executionContext), anyCollection(), 
any(ExecutionGroupReportContext.class))).thenReturn(jdbcExecutionGroupContext)))
 {
             when(regularExecutor.execute(any(), eq(jdbcExecutionGroupContext), 
eq(isReturnGeneratedKeys), anyBoolean())).thenReturn(expected);
             assertThat(proxySQLExecutor.execute(executionContext), 
is(expected));
         }
         verify(regularExecutor).execute(any(), eq(jdbcExecutionGroupContext), 
eq(isReturnGeneratedKeys), anyBoolean());
         if (expectedHookInvoked) {
-            verify(transactionHook).beforeExecuteSQL(eq(shardingSphereRule), 
eq(fixtureDatabaseType), anyCollection(),
-                    eq(transactionConnectionContext), 
eq(TransactionIsolationLevel.READ_COMMITTED));
-            return;
+            verify(transactionHook).beforeExecuteSQL(eq(shardingSphereRule), 
eq(fixtureDatabaseType), anyCollection(), eq(transactionConnectionContext), 
eq(TransactionIsolationLevel.READ_COMMITTED));
+        } else {
+            verify(transactionHook, never()).beforeExecuteSQL(any(), any(), 
anyCollection(), any(), any());
         }
-        verify(transactionHook, never()).beforeExecuteSQL(any(), any(), 
anyCollection(), any(), any());
+        
     }
     
     private Stream<Arguments> executeScenarios() {

Reply via email to