You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2023/01/01 02:06:53 UTC

[GitHub] [shardingsphere] Qianyi951015 opened a new pull request, #23233: Add `show mask rule` DistSQL unit test

Qianyi951015 opened a new pull request, #23233:
URL: https://github.com/apache/shardingsphere/pull/23233

   Ref: #23138.
   add unit test for #23199.
   
   Changes proposed in this pull request:
     - Add `show mask rule` DistSQL unit test
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang merged pull request #23233: Add `show mask rule` DistSQL unit test

Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #23233:
URL: https://github.com/apache/shardingsphere/pull/23233


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] codecov-commenter commented on pull request #23233: Add `show mask rule` DistSQL unit test

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #23233:
URL: https://github.com/apache/shardingsphere/pull/23233#issuecomment-1368328167

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/23233?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#23233](https://codecov.io/gh/apache/shardingsphere/pull/23233?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5d5dd22) into [master](https://codecov.io/gh/apache/shardingsphere/commit/b8e24e026aa91db64ee3e027d9a9d4880b5b4158?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b8e24e0) will **increase** coverage by `0.03%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #23233      +/-   ##
   ============================================
   + Coverage     49.89%   49.92%   +0.03%     
     Complexity     2453     2453              
   ============================================
     Files          4021     4021              
     Lines         57537    57537              
     Branches       9132     9132              
   ============================================
   + Hits          28706    28724      +18     
   + Misses        26289    26271      -18     
     Partials       2542     2542              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/23233?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ontend/executor/ConnectionThreadExecutorGroup.java](https://codecov.io/gh/apache/shardingsphere/pull/23233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJveHkvZnJvbnRlbmQvY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvZnJvbnRlbmQvZXhlY3V0b3IvQ29ubmVjdGlvblRocmVhZEV4ZWN1dG9yR3JvdXAuamF2YQ==) | `86.66% <0.00%> (+13.33%)` | :arrow_up: |
   | [.../mask/distsql/handler/query/MaskRuleResultSet.java](https://codecov.io/gh/apache/shardingsphere/pull/23233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmVhdHVyZXMvbWFzay9kaXN0c3FsL2hhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL21hc2svZGlzdHNxbC9oYW5kbGVyL3F1ZXJ5L01hc2tSdWxlUmVzdWx0U2V0LmphdmE=) | `88.88% <0.00%> (+88.88%)` | :arrow_up: |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #23233: Add `show mask rule` DistSQL unit test

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #23233:
URL: https://github.com/apache/shardingsphere/pull/23233#discussion_r1059712770


##########
features/mask/distsql/handler/src/test/java/org/apache/shardingsphere/mask/distsql/handler/query/MaskRuleResultSetTest.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mask.distsql.handler.query;
+
+import org.apache.shardingsphere.distsql.handler.resultset.DatabaseDistSQLResultSet;
+import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
+import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
+import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
+import org.apache.shardingsphere.mask.api.config.MaskRuleConfiguration;
+import org.apache.shardingsphere.mask.api.config.rule.MaskColumnRuleConfiguration;
+import org.apache.shardingsphere.mask.api.config.rule.MaskTableRuleConfiguration;
+import org.apache.shardingsphere.mask.distsql.parser.statement.ShowMaskRulesStatement;
+import org.apache.shardingsphere.mask.rule.MaskRule;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Optional;
+import java.util.Properties;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class MaskRuleResultSetTest {
+    
+    @Test
+    public void assertGetRowData() {
+        ShardingSphereDatabase database = mockDatabase();
+        DatabaseDistSQLResultSet resultSet = new MaskRuleResultSet();
+        resultSet.init(database, mock(ShowMaskRulesStatement.class));
+        assertColumns(resultSet.getColumnNames());
+        Collection<Object> actual = resultSet.getRowData();
+        assertTrue(actual.contains("t_mask"));
+        assertTrue(actual.contains("user_id"));
+        assertTrue(actual.contains("md5"));
+    }
+    
+    @Test
+    public void assertGetRowDataWithOutMaskRule() {

Review Comment:
   `WithOut` -> `Without`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org