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

actionscript 3 - TweenLite does not work with object -

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

c# - Global Variables vs. ASP.NET Session State -