Skip to content

Commit

Permalink
Add test cases on BroadcastRule
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Oct 31, 2024
1 parent 06b590c commit 2393308
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ private static Map<String, DataSource> mockDataSourceMap() {
}

private ShardingSphereRule mockBuiltRule() {
ShardingSphereRule result = mock(ShardingSphereRule.class);
DataSourceMapperRuleAttribute ruleAttribute = mock(DataSourceMapperRuleAttribute.class);
Map<String, Collection<String>> dataSourceMapper = new HashMap<>(2, 1F);
dataSourceMapper.put("foo_ds", Arrays.asList("foo_ds_0", "foo_ds_1"));
dataSourceMapper.put("bar_ds", Arrays.asList("bar_ds_0", "bar_ds_1"));
when(ruleAttribute.getDataSourceMapper()).thenReturn(dataSourceMapper);
ShardingSphereRule result = mock(ShardingSphereRule.class);
when(result.getAttributes()).thenReturn(new RuleAttributes(ruleAttribute));
return result;
}
Expand Down

0 comments on commit 2393308

Please sign in to comment.