-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
IMHO to really follow the hamcrest matchers design philosophy the argThat interface should look like this: public static <T> T argThat(Matcher<? super T> matcher), but unfortunately it is
| public static <T> T argThat(Matcher<T> matcher) { |
this change would allow a statement like the following:
verify(mock).aMethod(argThat(nullValue()))
I see that the default value is derived from the concrete matcher type, which of course would not work anymore. To circumvent this problem, it would be possible to provide a overload for primitives types.
Or provide a new argThat method, for example argThatSuper which always returns null, but of course would not work for primitive types. Than the existing argThat would keep its behavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels