"EasyMock.expectLastCall ();" do anything without a subsequent call to the resulting IExpectationSetters?

Consider this piece of code: -

Whatever mock = EasyMock.createMock( Whatever.class );
mock.doSomething();
EasyMock.expectLastCall();   // <- Does this do anything?
EasyMock.replay( whatever );

Is expectLastCall()there something doing here? Adding or removing this line from my test does not matter.

Obviously this is useful if you add .andThrowor .atLeastOnce()etc. to the challenge. This is not what I am asking for.

+5
source share
1 answer

No, you usually use expectLastCall()it when you need a result to indicate behavior. That is his goal.

, , , . , - , , , . , .

+5

All Articles