You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Pace2Car (via GitHub)" <gi...@apache.org> on 2023/04/12 05:58:59 UTC

[GitHub] [shardingsphere] Pace2Car commented on a diff in pull request #25075: Improve properties verification of ShadowAlgorithms #24749

Pace2Car commented on code in PR #25075:
URL: https://github.com/apache/shardingsphere/pull/25075#discussion_r1163657617


##########
features/shadow/core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/column/ColumnRegexMatchShadowAlgorithmTest.java:
##########
@@ -49,4 +50,17 @@ void assertExceptionCase() {
         assertThrows(UnsupportedShadowColumnTypeException.class,
                 () -> PreciseColumnShadowValueFixtureBuilder.createExceptionCase(SHADOW_TABLE, SHADOW_COLUMN).forEach(each -> assertFalse(shadowAlgorithm.isShadow(each))));
     }
+
+    @Test
+    void assertPropertiesWithoutColumn() {
+        assertThrows(ShadowAlgorithmInitializationException.class, () ->
+                TypedSPILoader.getService(ShadowAlgorithm.class, "REGEX_MATCH", PropertiesBuilder.build(new Property("operation", "insert"), new Property("value", "[1]"))));
+    }
+
+    @Test
+    void assertPropertiesWithWrongOperation() {
+        assertThrows(ShadowAlgorithmInitializationException.class, () ->
+                TypedSPILoader.getService(ShadowAlgorithm.class, "REGEX_MATCH",
+                                          PropertiesBuilder.build(new Property("column", SHADOW_COLUMN), new Property("operation", "inser"), new Property("value", "[1]"))));

Review Comment:
   Replacing `inser` with `wrong` is more explicit.



-- 
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