I have a class which has 2 methods. I want to mock the class and then mock the first method but not the 2nd one.
e.g.
class C {
void m1() { ...}
boolean m2() { ... return flag;}
}
unit test code:
C cMock = Mockito.mock(C.class);
Mockito.doNothing().when(cMock).m1();
Mockito.when(cMock.m2()).thenCallRealMethod();
The strange thing is that m2 is not being called.
do I miss anything here?