Mock an object in a method that is not a parameter in java similar to the following python code? -


following cool mocking python, there anyway in java?

mockpath = os.path mockpath.isdir = mock(return_value=false) myobj = myclass() myobj.invoke_some_method() myobj.some_other_method.assert_called_with(false) 

is possible in java? meaning updating return values , behavior of objects instantiated inside other object methods in such convenient way? framework nicely?

thanks

mockito supports partial mocks mocking out method in real class. latter looks more similar python example.

i believe easymock supports same thing i'm having trouble finding in documentation.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -