Skip to content

Commit

Permalink
Refactor ShadowRuleConfigurationChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Sep 30, 2023
1 parent 65f3a08 commit 6f4528d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public void check(final String databaseName, final ShadowRuleConfiguration confi
}

private void checkDataSources(final Map<String, ShadowDataSourceConfiguration> shadowDataSources, final Map<String, DataSource> dataSourceMap, final String databaseName) {
Set<String> dataSource = dataSourceMap.keySet();
Collection<String> dataSourceName = dataSourceMap.keySet();
for (Entry<String, ShadowDataSourceConfiguration> entry : shadowDataSources.entrySet()) {
ShardingSpherePreconditions.checkState(dataSource.contains(entry.getValue().getProductionDataSourceName()),
ShardingSpherePreconditions.checkState(dataSourceName.contains(entry.getValue().getProductionDataSourceName()),
() -> new MissingRequiredShadowConfigurationException("ProductionDataSourceName", databaseName));
ShardingSpherePreconditions.checkState(dataSource.contains(entry.getValue().getShadowDataSourceName()),
ShardingSpherePreconditions.checkState(dataSourceName.contains(entry.getValue().getShadowDataSourceName()),
() -> new MissingRequiredShadowConfigurationException("ShadowDataSourceName", databaseName));
}
}
Expand Down

0 comments on commit 6f4528d

Please sign in to comment.