Mocking, Stubbing and Test Spying using the Mockito Framework and PowerMock

Today we’re going to take a look at the Mockito framework that not only does sound like my favourite summer cocktail but also offers nice testing, mocking/stubbing, test-spying features and mock injections. After that we’re going to take a look on how to mock static or final classes by extending Mockito’s capabilities with PowerMock. Prerequisites We don’t need much for the following samples .. Java of course, Maven dependency management and that’s all .. ...

March 27, 2011 · 8 min · 1620 words · Micha Kops