Reputation: 5073
I want to use EasyMock for testing. One of the service call takes an object. In my class that uses the service, the object is constructed inside my method. I can construct the object in the test beforehand but the object isn't the same one as in my class' method. To make EasyMock work, I have to use eq(). But unfortunately, the object class is part of the service's package and doesn't override Object.equal(). How can I work around this? There is something called custom argument matcher. Does it serve my purpose? Thank you.
Upvotes: 1
Views: 3028
Reputation: 691715
You don't have to use eq()
. You can use any other matcher as well, such as anyObject()
, isA()
, capture()
or notNull()
.
Upvotes: 1
Reputation: 11280
If you don't care about the argument's state you could use anyObject()
Upvotes: 1