You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2019/12/16 05:26:14 UTC

[GitHub] [incubator-dolphinscheduler] clay4444 opened a new issue #1484: [QUESTION] UT in AbstractZKClient

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


With regards,
Apache Git Services