AlgorithmProvidedShardingRuleBuilder implements ShardingSphereRuleBuilder<ShardingRule, AlgorithmProvidedShardingRuleConfiguration> { @Override public ShardingRule build(final AlgorithmProvidedShardingRuleConfiguration ruleConfig, final Collection<String> dataSourceNames) { return new ShardingRule(ruleConfig, dataSourceNames); }  @Override ShardingRule build(final AlgorithmProvidedShardingRuleConfiguration ruleConfig, final Collection<String> dataSourceNames); @Override int getOrder(); @Override Class<AlgorithmProvidedShardingRuleConfiguration> getTypeClass();  }
@Test public void assertBuild() { AlgorithmProvidedShardingRuleConfiguration ruleConfig = mock(AlgorithmProvidedShardingRuleConfiguration.class); ShardingSphereRuleBuilder builder = OrderedSPIRegistry.getRegisteredServices(Collections.singletonList(ruleConfig), ShardingSphereRuleBuilder.class).get(ruleConfig); assertThat(builder.build(ruleConfig, Collections.singletonList("name")), instanceOf(ShardingRule.class)); }