Mocking static methods?This wasn't obvious to me at first, it took me a while to get why we can't mock static methods. So here it goes the reason in one line,
"Static methods aren't polymorphic, they are resolved at compile time, therefor it's not possible to use mock objects to test."
Hope this help you guys who are scratching your head like I was.... (if you are not sure about polymorphism, think of it as late binding)
btw, mock objects are great, it's one of those things that once you discovered how to use them, you wonder how you ever survived without them in the first place. There are plenty of resources on the web about them, see the documentation from easymock for a quick introduction.
done: use mock objects to help speed unit testing.