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

如何mock静态常量。。 #33

Open
yymoxiaochi opened this issue Mar 16, 2020 · 0 comments
Open

如何mock静态常量。。 #33

yymoxiaochi opened this issue Mar 16, 2020 · 0 comments

Comments

@yymoxiaochi
Copy link

项目里会有一些静态常量,在项目启动是通过静态初始化取到值,虽然我瞎琢磨,通过mock up来改值,但是不同分支(比如needMockValue为1或2)我得new不同的mockup,有什么更方便的方法吗?
@Mock public void $clinit() { Deencapsulation.setField(Config.class, "needMockValue", "newVaule"); }

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

No branches or pull requests

1 participant