wenweibin commented on issue #8067:
URL: https://github.com/apache/shardingsphere/issues/8067#issuecomment-724091826


   @terrymanu  Does this issue mean to replace `TestShardingRule` ,` 
TestTableRule`,`TestShardingSphereRule`  and `TestDataSourceRoutedRule`  with 
mock in `DataNodesTest` class? Such as the following:
   
   ```
       private DataNodes getRoutedRuleDataNodes() {
           Map<String, Collection<DataNode>> nodeMap = new HashMap<>();
           
nodeMap.put(logicTableName1,generateDataNodes(logicTableName1,dataSourceNames1));
           
nodeMap.put(logicTableName2,generateDataNodes(logicTableName2,dataSourceNames2));
           DataNodeRoutedRule rule1 = mock(DataNodeRoutedRule.class);
           when(rule1.getAllDataNodes()).thenReturn(nodeMap);
           DataSourceRoutedRule rule2 = mock(DataSourceRoutedRule.class);
           Map<String, Collection<String>> dataSourceMapper = 
Collections.singletonMap(logicDataSourceName, replicaDataSourceNames);
           when(rule2.getDataSourceMapper()).thenReturn(dataSourceMapper);
           return new DataNodes(Arrays.asList(rule1, rule2));
       }
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to