You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: