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 2024/11/14 06:44:08 UTC

(shardingsphere) branch master updated: Add more test cases on EncryptSelectProjectionSupportedChecker (#33655)

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 b8053dbdef5 Add more test cases on EncryptSelectProjectionSupportedChecker (#33655)
b8053dbdef5 is described below

commit b8053dbdef58f9b83b8549a8e7e00d3832aa5a92
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu Nov 14 14:44:02 2024 +0800

    Add more test cases on EncryptSelectProjectionSupportedChecker (#33655)
---
 .../projection/EncryptSelectProjectionSupportedCheckerTest.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/checker/sql/projection/EncryptSelectProjectionSupportedCheckerTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/checker/sql/projection/EncryptSelectProjectionSupportedCheckerTest.java
index 858fb0bb4ca..10157dd52c5 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/checker/sql/projection/EncryptSelectProjectionSupportedCheckerTest.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/checker/sql/projection/EncryptSelectProjectionSupportedCheckerTest.java
@@ -86,11 +86,11 @@ class EncryptSelectProjectionSupportedCheckerTest {
     }
     
     private SelectStatementContext mockSelectStatementContext() {
-        SelectStatementContext sqlStatementContext = mock(SelectStatementContext.class, RETURNS_DEEP_STUBS);
+        SelectStatementContext result = mock(SelectStatementContext.class, RETURNS_DEEP_STUBS);
         CombineSegment combineSegment = mock(CombineSegment.class, RETURNS_DEEP_STUBS);
         when(combineSegment.getLeft().getStartIndex()).thenReturn(0);
         when(combineSegment.getRight().getStartIndex()).thenReturn(1);
-        when(sqlStatementContext.getSqlStatement().getCombine()).thenReturn(Optional.of(combineSegment));
+        when(result.getSqlStatement().getCombine()).thenReturn(Optional.of(combineSegment));
         ColumnProjection leftColumn1 = new ColumnProjection(new IdentifierValue("f"), new IdentifierValue("foo_col_1"), null, databaseType,
                 null, null, new ColumnSegmentBoundInfo(new IdentifierValue(""), new IdentifierValue(""), new IdentifierValue("foo_tbl"), new IdentifierValue("foo_col_1")));
         ColumnProjection leftColumn2 = new ColumnProjection(new IdentifierValue("f"), new IdentifierValue("foo_col_2"), null, databaseType,
@@ -106,8 +106,8 @@ class EncryptSelectProjectionSupportedCheckerTest {
         Map<Integer, SelectStatementContext> subqueryContexts = new LinkedHashMap<>(2, 1F);
         subqueryContexts.put(0, leftSelectStatementContext);
         subqueryContexts.put(1, rightSelectStatementContext);
-        when(sqlStatementContext.getSubqueryContexts()).thenReturn(subqueryContexts);
-        return sqlStatementContext;
+        when(result.getSubqueryContexts()).thenReturn(subqueryContexts);
+        return result;
     }
     
     private EncryptRule mockEncryptRule() {