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