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 2022/01/27 14:31:51 UTC

[GitHub] [shardingsphere] totalo commented on a change in pull request #15116: Assert Readwrite-Splitting rule configuration in YamlProxyConfigurati…

totalo commented on a change in pull request #15116:
URL: https://github.com/apache/shardingsphere/pull/15116#discussion_r793664002



##########
File path: shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/test/java/org/apache/shardingsphere/proxy/config/yaml/swapper/YamlProxyConfigurationSwapperTest.java
##########
@@ -77,7 +80,19 @@ private void assertSchemaRules(final ProxyConfiguration proxyConfig) {
     }
     
     private void assertReadwriteSplittingRuleConfiguration(final ReadwriteSplittingRuleConfiguration actual) {
-        // TODO complete assert 
+        assertThat(actual.getDataSources().size(), is(1));
+        ReadwriteSplittingDataSourceRuleConfiguration dataSource = actual.getDataSources().iterator().next();
+        assertThat(dataSource.getName(), is("readwrite_ds"));
+        assertThat(dataSource.getType(), is("Static"));
+        assertThat(dataSource.getProps().size(), is(2));
+        assertThat(dataSource.getProps().getProperty("read-data-source-names"), is("foo_db"));
+        assertThat(dataSource.getProps().getProperty("write-data-source-name"), is("foo_db"));
+        assertThat(actual.getLoadBalancers().size(), is(1));
+        ShardingSphereAlgorithmConfiguration loadBalancer = actual.getLoadBalancers().get("round_robin");

Review comment:
       This seems unnecessary.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org