You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/11/07 08:52:35 UTC

[GitHub] [shardingsphere] terrymanu opened a new issue #8067: Use mock to instead of TestShardingRule and TestTableRule

terrymanu opened a new issue #8067:
URL: https://github.com/apache/shardingsphere/issues/8067


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] wenweibin commented on issue #8067: Use mock to instead of TestShardingRule and TestTableRule

Posted by GitBox <gi...@apache.org>.
wenweibin commented on issue #8067:
URL: https://github.com/apache/shardingsphere/issues/8067#issuecomment-723587936


   Please assign  to me


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] wenweibin commented on issue #8067: Use mock to instead of TestShardingRule and TestTableRule

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [shardingsphere] kimmking closed issue #8067: Use mock to instead of TestShardingRule and TestTableRule

Posted by GitBox <gi...@apache.org>.
kimmking closed issue #8067:
URL: https://github.com/apache/shardingsphere/issues/8067


   


----------------------------------------------------------------
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:
users@infra.apache.org