I have a method call which I want to mock with mockito. To start with I have created and injected an instance of an object on which the method will be called. My aim is to v
I think the easiest way for verifying an argument object is to use the refEq method:
Mockito.verify(mockedObject).someMethodOnMockedObject(ArgumentMatchers.refEq(objectToCompareWith));
It can be used even if the object doesn't implement equals(), because reflection is used. If you don't want to compare some fields, just add their names as arguments for refEq.