ShardingRule implements DataNodeRoutedRule { public boolean isAllBroadcastTables(final Collection<String> logicTableNames) { return !logicTableNames.isEmpty() && logicTableNames.stream().allMatch(this::isBroadcastTable); } ShardingRule(final ShardingRuleConfiguration config, final Collection<String> dataSourceNames);  ShardingRule(final AlgorithmProvidedShardingRuleConfiguration config, final Collection<String> dataSourceNames); Optional<TableRule> findTableRule(final String logicTableName); Optional<TableRule> findTableRuleByActualTable(final String actualTableName); TableRule getTableRule(final String logicTableName); ShardingStrategy getDatabaseShardingStrategy(final TableRule tableRule); ShardingStrategy getTableShardingStrategy(final TableRule tableRule); boolean isAllBindingTables(final Collection<String> logicTableNames); Optional<BindingTableRule> findBindingTableRule(final String logicTableName); boolean isAllBroadcastTables(final Collection<String> logicTableNames); boolean isBroadcastTable(final String logicTableName); boolean tableRuleExists(final Collection<String> logicTableNames); boolean isShardingColumn(final String columnName, final String tableName); boolean isGenerateKeyColumn(final String columnName, final String tableName); Optional<String> findGenerateKeyColumnName(final String logicTableName); Comparable<?> generateKey(final String logicTableName); DataNode getDataNode(final String logicTableName); DataNode getDataNode(final String dataSourceName, final String logicTableName); Collection<String> getShardingLogicTableNames(final Collection<String> logicTableNames); Map<String, String> getLogicAndActualTablesFromBindingTable(final String dataSourceName,
                                                                       final String logicTable, final String actualTable, final Collection<String> availableLogicBindingTables); @Override Map<String, Collection<DataNode>> getAllDataNodes(); @Override Collection<String> getAllActualTables(); @Override Optional<String> findFirstActualTable(final String logicTable); @Override boolean isNeedAccumulate(final Collection<String> tables); @Override Optional<String> findLogicTableByActualTable(final String actualTable);  }
@Test public void assertIsAllBroadcastTableWhenLogicTablesIsEmpty() { assertFalse(createMaximumShardingRule().isAllBroadcastTables(Collections.emptyList())); }
@Test public void assertIsAllBroadcastTable() { assertTrue(createMaximumShardingRule().isAllBroadcastTables(Collections.singletonList("Broadcast_Table"))); }
@Test public void assertIsNotAllBroadcastTable() { assertFalse(createMaximumShardingRule().isAllBroadcastTables(Arrays.asList("broadcast_table", "other_table"))); }