PrimaryReplicaReplicationRule implements DataSourceRoutedRule, StatusContainedRule { public Optional<PrimaryReplicaReplicationDataSourceRule> findDataSourceRule(final String dataSourceName) { return Optional.ofNullable(dataSourceRules.get(dataSourceName)); } PrimaryReplicaReplicationRule(final PrimaryReplicaReplicationRuleConfiguration config);  PrimaryReplicaReplicationRule(final AlgorithmProvidedPrimaryReplicaReplicationRuleConfiguration config); PrimaryReplicaReplicationDataSourceRule getSingleDataSourceRule(); Optional<PrimaryReplicaReplicationDataSourceRule> findDataSourceRule(final String dataSourceName); @Override Map<String, Collection<String>> getDataSourceMapper(); @Override void updateRuleStatus(final RuleChangedEvent event);  }
@Test public void assertFindDataSourceRule() { Optional<PrimaryReplicaReplicationDataSourceRule> actual = createPrimaryReplicaReplicationRule().findDataSourceRule("test_pr"); assertTrue(actual.isPresent()); assertDataSourceRule(actual.get()); }