clay4444 opened a new issue #1484: [QUESTION] UT in AbstractZKClient
URL: https://github.com/apache/incubator-dolphinscheduler/issues/1484
 
 
   
   **Describe the question**
   I encountered some problems when I tried to do the UT of AbstractZKClient. 
This class is restricted by a static code block. It can only be taken from the 
configuration file in the class path, but the configuration file is copied only 
when the project is packaged, this makes it impossible to perform UT on this 
class even using Mockito (Mockito is implemented based on subclass inheritance)
   
   **Which version of DolphinScheduler:**
    -[1.2.0]
   
   **Additional context**
   None
   
   **Requirement or improvement
   my suggestion is to put the content of the static code block into the 
initial parameterless constructor, and then add a constructor that passes in 
other configurations. This is also for scalability considerations, although the 
current subclasses are singletons. However, if other classes need to use zk 
clients to connect to other zk in the future, you can also inherit this class 
to avoid code duplication.
   

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