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 98c2fcb2425 Add more test cases on BroadcastRuleTest (#38218)
98c2fcb2425 is described below
commit 98c2fcb2425c87092e71cadc70d36d62a591ccce
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Feb 26 20:41:37 2026 +0800
Add more test cases on BroadcastRuleTest (#38218)
---
.../apache/shardingsphere/broadcast/rule/BroadcastRuleTest.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git
a/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/rule/BroadcastRuleTest.java
b/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/rule/BroadcastRuleTest.java
index e1194d29078..e7cc4ccb96c 100644
---
a/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/rule/BroadcastRuleTest.java
+++
b/features/broadcast/core/src/test/java/org/apache/shardingsphere/broadcast/rule/BroadcastRuleTest.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.broadcast.rule;
import org.apache.shardingsphere.broadcast.config.BroadcastRuleConfiguration;
+import org.apache.shardingsphere.broadcast.constant.BroadcastOrder;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.attribute.RuleAttributes;
import
org.apache.shardingsphere.infra.rule.attribute.datasource.DataSourceMapperRuleAttribute;
@@ -31,8 +32,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import static org.hamcrest.Matchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -69,4 +70,10 @@ class BroadcastRuleTest {
BroadcastRule rule = new BroadcastRule(new
BroadcastRuleConfiguration(Collections.singleton("foo_tbl")),
Collections.emptyMap(), Collections.emptyList());
assertThat(rule.getBroadcastTableNames(Arrays.asList("foo_tbl",
"bar_tbl")), is(Collections.singleton("foo_tbl")));
}
+
+ @Test
+ void assertGetOrder() {
+ BroadcastRule rule = new BroadcastRule(new
BroadcastRuleConfiguration(Collections.singleton("foo_tbl")),
Collections.emptyMap(), Collections.emptyList());
+ assertThat(rule.getOrder(), is(BroadcastOrder.ORDER));
+ }
}