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 2026/03/20 05:42:43 UTC

(shardingsphere) branch master updated: Add more test cases on DatabaseRuleDropExecutorTest (#38526)

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 8ce4859c9bd Add more test cases on DatabaseRuleDropExecutorTest (#38526)
8ce4859c9bd is described below

commit 8ce4859c9bdbbf4e528d77e74103e16bebe81c74
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Mar 20 13:42:38 2026 +0800

    Add more test cases on DatabaseRuleDropExecutorTest (#38526)
---
 .../type/DatabaseRuleDropExecutorTest.java         | 49 ++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/engine/update/rdl/rule/spi/database/type/DatabaseRuleDropExecutorTest.java b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/engine/update/rdl/rule/spi/database/type/DatabaseRuleDropExecutorTest.java
new file mode 100644
index 00000000000..b79e5081b8d
--- /dev/null
+++ b/infra/distsql-handler/src/test/java/org/apache/shardingsphere/distsql/handler/engine/update/rdl/rule/spi/database/type/DatabaseRuleDropExecutorTest.java
@@ -0,0 +1,49 @@
+/*
+ * 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.distsql.handler.engine.update.rdl.rule.spi.database.type;
+
+import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
+import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
+import org.apache.shardingsphere.sql.parser.statement.core.statement.SQLStatement;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.CALLS_REAL_METHODS;
+import static org.mockito.Mockito.mock;
+
+class DatabaseRuleDropExecutorTest {
+    
+    @SuppressWarnings("unchecked")
+    private final DatabaseRuleDropExecutor<SQLStatement, ShardingSphereRule, RuleConfiguration> executor = mock(DatabaseRuleDropExecutor.class, CALLS_REAL_METHODS);
+    
+    @Test
+    void assertBuildToBeDroppedRuleConfiguration() {
+        assertNull(executor.buildToBeDroppedRuleConfiguration(mock(SQLStatement.class)));
+    }
+    
+    @Test
+    void assertBuildToBeAlteredRuleConfiguration() {
+        assertNull(executor.buildToBeAlteredRuleConfiguration(mock(SQLStatement.class)));
+    }
+    
+    @Test
+    void assertHasAnyOneToBeDropped() {
+        assertTrue(executor.hasAnyOneToBeDropped(mock(SQLStatement.class)));
+    }
+}