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被测试方法的父类中的依赖 #39

Open
ZiTian8 opened this issue Jul 24, 2020 · 0 comments
Open

如何mock被测试方法的父类中的依赖 #39

ZiTian8 opened this issue Jul 24, 2020 · 0 comments

Comments

@ZiTian8
Copy link

ZiTian8 commented Jul 24, 2020

你好,我在使用jmockit测试一个类时,碰到一个问题,简单描述如下,需要测试A类的a方法,A类有依赖H,且a方法中调用了H中的方法h1。然后A继承了B类,且a方法中调用了父类B中的b方法,同样的B类有依赖H,b方法调用了h2方法。我在测试方法中mock了h1方法和h2方法的返回值,在A类中,h1方法有返回值,但是在B中,H为null,请问这个情况应该怎么处理,谢谢。

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

2 participants
@ZiTian8 and others