Java Mailing List Archive

Home » user.jmock »

[jmock-user] How to mock test method with multi level dependency



Replies: Find Java Web Hosting

Author LoginPost Reply

I am writing mock junit tests for our existing application. The main class
is a Facade for which I am writing tests currently. In some cases methods of
this class has calls to multi level dependency. For example in method that I
am testing, there is a call like -


In this case I am not able to use mock for 2ndLevelDependency and not able
to use expectation on the getXyz() call.

Please suggest what is the best way to handle such scenario.

Sent from the jMock - User mailing list archive at

To unsubscribe from this list, please visit:

©2008 - Jax Systems, LLC, U.S.A.