0

How can I use Easymock.verify(mockedObject); to check only a specific expected method call on that mocked object instead of checking all the expected methods.

In another words how can I verify the call of specific method rather than all of them.

Thanks.

Sara
  • 2,417
  • 7
  • 35
  • 52

1 Answers1

1

Explicitly set the number of calls expected of the methods that you do not want to check to .anyTimes()

expect(mymock.unwantedMethod()).andReturn("something).anyTimes()

or make it a stub implementation:

expect(mymock.unwantedMethod()).andStubReturn("something)

This way only the expected method call will be validated.

Biju Kunjummen
  • 49,138
  • 14
  • 112
  • 125