Reputation: 13342
How to check that compareTo
method will be invoked with this argument new ComparableVersion("1"))
verify(comparableVersion).compareTo(any(ComparableVersion.class));
Now I use any
- this is not enough.
Upvotes: 1
Views: 477
Reputation: 13821
If you implement a proper equals
method in your class, you can use the eq
matcher. It will not verify your constructor, but it will verify against an object that has been initialized to a known state.
Upvotes: 1