Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] UT in AbstractZKClient #1484

Closed
clay4megtr opened this issue Dec 16, 2019 · 2 comments
Closed

[QUESTION] UT in AbstractZKClient #1484

clay4megtr opened this issue Dec 16, 2019 · 2 comments
Labels
question Further information is requested

Comments

@clay4megtr
Copy link
Contributor

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.

@clay4megtr clay4megtr added the question Further information is requested label Dec 16, 2019
@davidzollo
Copy link
Contributor

good idea, please submit a pr to resolve this, thanks

@clay4megtr
Copy link
Contributor Author

yeah~ I am already doing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants