wood burning stoves 2.0*
The moose likes Testing and the fly likes test spy and mock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "test spy and mock" Watch "test spy and mock" New topic
Author

test spy and mock

David Spades
Ranch Hand

Joined: Feb 01, 2014
Posts: 194
Hi,

I read that we should not use mocks if a failed assertion cannot be reported effectively back to the Test Runner. This may be the case if the tested object is running inside a container that catches and eats all exceptions. In these cases we may be better off using a Test Spy.

Could anyone please explain about this? I mean can anybody show an example of an object that's running inside a container where mocks would fail and spy won't?
thanks
Tim Cooke
Bartender

Joined: Mar 28, 2008
Posts: 822
    
  38

That's quite a broad question. What do you mean by "container"? And what kind of assertion are you talking about?


Tim Driven Development
 
wood burning stoves
 
subject: test spy and mock
 
Similar Threads
jmock query
JUnit Mockito - Spy creating mock - how to stub that mock
few basic Q ( in & out container )
Ejb3 unit testing
Agile Java: to the author