We're rolling out Mockito and trying to raise our testability at work and I'm set to give a presentation/training session tomorrow to a few new teams. In case you don't know, Mockito is a mock object framework for Java. It's competitors are EasyMock, JMock, and others if you're more familiar with those. If you haven't seen it then you may want to check out my old post "Mockito - Pros, Cons, and Best Practices". To prepare for my presentation I decided to record myself practicing my material and post it on youtube. Enjoy!
The first screencast is about creating mock objects and stubbing behavior. These are the absolute basics of mocking.
The second screencast is about verifying behavior, or verifying side effects, using Mockito. This is a little more advanced but still an essential API in working with Mockito. YouTube reports this video as 13 minutes long, but don't worry it is only 4:45. Some quirk of YouTube.
The final screencast is about argument matchers, which add flexibility to your stub and verify phases.
I hope you enjoyed these. They could be a little more practiced, but I'm happy enough with the quality. I recorded these on Ubuntu 10.4 using recordMyDesktop and mencode to convert from .ogv to .avi.
Tuesday, December 14, 2010
Mockito – Screencasts for Stubbing, Verifying, and Argument Matching
Posted by Hamlet D'Arcy at 11:40 PM
Labels: java, unit testing
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment