I wonder if someone has a good example of a ‘record & play’ code where I can record the call / response of certain methods and then use that to build mock objects for testing.
The specific problem I’m trying to solve is when testing code that relies on external web services. I’d like to be able to record the responses to call such as say (using Twitter as an example):
- create a tweet
- reply to a tweet
- get a user timeline
And, then when I test I’d like to be able to intercept the call stack and use earlier responses to build responses.
Thanks.
Some people asked me that, this is doable with the custom answer feature in Mockito. Still, while doable nobody that I know of worked on it and made it public/open source.
Cheers