kimmking commented on a change in pull request #4545: Issue2010
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4545#discussion_r386165802
 
 

 ##########
 File path: 
shardingsphere-underlying/shardingsphere-common/src/test/java/org/apache/shardingsphere/underlying/common/config/DataSourceConfigurationTest.java
 ##########
 @@ -83,4 +88,25 @@ public void assertAddAlias() {
         assertThat(actual.getProperties().get("jdbcUrl"), 
is(actual.getProperties().get("url")));
         assertThat(actual.getProperties().get("username"), 
is(actual.getProperties().get("user")));
     }
+    
+    @Test
+    public void assertGetDataSourceConfigurationWithConnectionInitSqls() 
throws SQLException {
 
 Review comment:
   Here is an integration test.
   I suggestion:
   1. if do this way, it's neccesary to use HikariDataSource instead of 
BasicDatasource.
   2. creat a table in h2 db, and set an insert sql to initSql, then check it 
work well by a select and compare.
   
   Or another approach: 
   just mock a jdbc driver behind HikariDataSource, check hikariDataSource send 
the initSql to mock jdbc connection/statement.
   

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


With regards,
Apache Git Services

Reply via email to