Java Mailing List Archive

http://www.gg3721.com/

Home » user.jmock »

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

meSubho

2012-01-12

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi,
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 -

   dependency1.get2ndLevelDependency().getXyz();

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.

Thanks,
Subho
--
Sent from the jMock - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


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