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 2025/07/04 14:19:54 UTC

(shardingsphere) branch master updated: Refactor IndexTokenTest (#35883)

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 c1d497cca1d Refactor IndexTokenTest (#35883)
c1d497cca1d is described below

commit c1d497cca1d15b16059896fcf3613a953c646238
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Jul 4 22:19:48 2025 +0800

    Refactor IndexTokenTest (#35883)
---
 .../shardingsphere/sharding/rewrite/token/pojo/IndexTokenTest.java     | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/IndexTokenTest.java b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/IndexTokenTest.java
index 6f9228bdb24..3a3278f5f53 100644
--- a/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/IndexTokenTest.java
+++ b/features/sharding/core/src/test/java/org/apache/shardingsphere/sharding/rewrite/token/pojo/IndexTokenTest.java
@@ -59,8 +59,7 @@ class IndexTokenTest {
     
     @Test
     void assertToStringWithShardingTableAndGeneratedIndex() {
-        CommonSQLStatementContext sqlStatementContext = mock(CommonSQLStatementContext.class, RETURNS_DEEP_STUBS);
-        when(sqlStatementContext.getSqlStatement()).thenReturn(new CreateIndexStatement());
+        CommonSQLStatementContext sqlStatementContext = new CommonSQLStatementContext(mock(), new CreateIndexStatement());
         IndexToken indexToken = new IndexToken(0, 0, new IdentifierValue("bar_idx"), sqlStatementContext, mock(ShardingRule.class), mockSchema());
         assertThat(indexToken.toString(mockRouteUnit()), is(" bar_idx_foo_tbl_0 "));
     }