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 7e3f26abea8 Refactor ShowMaskRuleExecutorTest (#32771)
7e3f26abea8 is described below
commit 7e3f26abea87a131c44cfb75628aac853bbfd160
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Sep 2 19:56:06 2024 +0800
Refactor ShowMaskRuleExecutorTest (#32771)
---
.../handler/query/ShowMaskRuleExecutorTest.java | 26 +++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git
a/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutorTest.java
b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutorTest.java
index 6a9615127ae..86db35a26e7 100644
---
a/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutorTest.java
+++
b/features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/query/ShowMaskRuleExecutorTest.java
@@ -55,19 +55,6 @@ class ShowMaskRuleExecutorTest {
engine = new DistSQLQueryExecuteEngine(showMaskRulesStatement,
"foo_db", mockContextManager(), mock(DistSQLConnectionContext.class));
}
- @Test
- void assertGetRowData() throws SQLException {
- engine.executeQuery();
- Collection<LocalDataQueryResultRow> actual = engine.getRows();
- assertThat(actual.size(), is(1));
- Iterator<LocalDataQueryResultRow> iterator = actual.iterator();
- LocalDataQueryResultRow row = iterator.next();
- assertThat(row.getCell(1), is("t_mask"));
- assertThat(row.getCell(2), is("user_id"));
- assertThat(row.getCell(3), is("md5"));
- assertThat(row.getCell(4), is(""));
- }
-
private ContextManager mockContextManager() {
ContextManager result = mock(ContextManager.class, RETURNS_DEEP_STUBS);
ShardingSphereDatabase database = mock(ShardingSphereDatabase.class,
RETURNS_DEEP_STUBS);
@@ -84,4 +71,17 @@ class ShowMaskRuleExecutorTest {
AlgorithmConfiguration algorithmConfig = new
AlgorithmConfiguration("md5", new Properties());
return new
MaskRuleConfiguration(Collections.singleton(maskTableRuleConfig),
Collections.singletonMap("t_mask_user_id_md5", algorithmConfig));
}
+
+ @Test
+ void assertGetRowData() throws SQLException {
+ engine.executeQuery();
+ Collection<LocalDataQueryResultRow> actual = engine.getRows();
+ assertThat(actual.size(), is(1));
+ Iterator<LocalDataQueryResultRow> iterator = actual.iterator();
+ LocalDataQueryResultRow row = iterator.next();
+ assertThat(row.getCell(1), is("t_mask"));
+ assertThat(row.getCell(2), is("user_id"));
+ assertThat(row.getCell(3), is("md5"));
+ assertThat(row.getCell(4), is(""));
+ }
}