breeze0812 opened a new issue #3586:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3586


   **Describe the question**
   Extract the function `getConnection(DbType` dbType, String parameter)` from 
the `DataSourceService.java` as a public function
   
   **What are the current deficiencies and the benefits of improvement**
   - The getConnection function, which can be used to read/write data in 
addition to testing the database connection, currently exists as a private 
function in the 'datasourceservice.java' class:
   1. The function itself has nothing to do with the DataSource; its 
relationship to the function within the DataSourceService should be 
called/invoked rather than included.
   2. Bad for function reuse.
   3. When writing a test case for a DataSourceService, it is not easy to use 
the `mock` agent to mock its execution results because it is a private function
   
   **Which version of DolphinScheduler:**
    -[dev]


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


Reply via email to