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 a04477203a6 Add more test cases on SingleConstraintReviserTest (#38083)
a04477203a6 is described below

commit a04477203a68444d17349dc5ce4f1f3100e85c5c
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Feb 18 18:06:27 2026 +0800

    Add more test cases on SingleConstraintReviserTest (#38083)
---
 .../constraint/SingleConstraintReviserTest.java    | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git 
a/kernel/single/core/src/test/java/org/apache/shardingsphere/single/metadata/reviser/constraint/SingleConstraintReviserTest.java
 
b/kernel/single/core/src/test/java/org/apache/shardingsphere/single/metadata/reviser/constraint/SingleConstraintReviserTest.java
new file mode 100644
index 00000000000..e6ffccb263b
--- /dev/null
+++ 
b/kernel/single/core/src/test/java/org/apache/shardingsphere/single/metadata/reviser/constraint/SingleConstraintReviserTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.single.metadata.reviser.constraint;
+
+import 
org.apache.shardingsphere.database.connector.core.metadata.data.model.ConstraintMetaData;
+import org.apache.shardingsphere.single.rule.SingleRule;
+import org.junit.jupiter.api.Test;
+
+import java.util.Optional;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.mock;
+
+class SingleConstraintReviserTest {
+    
+    @Test
+    void assertRevise() {
+        ConstraintMetaData originalMetaData = new 
ConstraintMetaData("idx_foo_tbl_id_foo_tbl_0", "foo_tbl");
+        Optional<ConstraintMetaData> actual = new 
SingleConstraintReviser().revise("foo_tbl_0", originalMetaData, 
mock(SingleRule.class));
+        assertTrue(actual.isPresent());
+        assertThat(actual.get().getName(), is("idx_foo_tbl_id"));
+        assertThat(actual.get().getReferencedTableName(), is("foo_tbl"));
+    }
+}

Reply via email to