When working with legacy code I think Powermock is even more appropriate than Mockito thanks to its ability to mock static methods and new operator.
Note also that Mockito lets you verify that your test just called the methods you verified :
--------------
Dependency1 dependency1 = Mockito.mock(Dependency1.class);
Dependency2 dependency2 = Mockito.mock(Dependency2.class);
ClassUnderTest classUnderTest = new ClassUnderTest(dependency1, dependency2 );
classUnderTest.doSomething();
Mockito.verify(dependency1).doSomethingElse();
Mockito.verify(dependency2).doAnotherThing();
Mockito.verifyNoMoreInteractions(dependency1, dependency2);
--------------
Another way of doing this would be to change the default behavior of a mock. You could easily make your test fail if a unstubbed method is called on a mock :
--------------
Dependency dependency= Mockito.mock(Dependency.class, new Answer<dependency>() {
....public Dependency answer(InvocationOnMock invocation) throws Throwable {
........throw new RuntimeException(invocation.getMethod().getName() + " is not stubbed");
....}
});
Mockito.doReturn(0).when(dependency).doSomething();
ClassUnderTest classUnderTest = new ClassUnderTest(dependency);
classUnderTest.doSomething();
--------------
This way you'll have to stub all the methods of "dependency" called during your test, otherwise your test will fail. Comment "doReturn..." to make the test fail.
I never used Jmock, so I don't make the comparison with Mockito. I just wanted to point out that Mockito can be more strict if you want it to.