Hello!
Given an object like the following:
public class Stuff {
public Result doStuff(Pojo pojo) {
// ...
}
}
with
public class Pojo {
String bar;
Integer baz;
// getters, setters
}
is it possible to write a custom ArgumentMatcher for Pojo, so that you can write
when(mock.doStuff(argThat(new MyMatcher(eq("myBarValue"), anyInteger())))).thenReturn(/* ... */);
using Mockito's matchers to perform "fuzzy" matching (e.g. any Integer will do this time)?
In other words, is it possible to write a custom ArgumentMatcher that supports Mockito's Matchers/ArgumentMatchers - in particular any() (and eq())?
Kind regards,
Christian
P.S.: Adding an equals method to Pojo is unfortunately not possible in my case.