@Target(value=METHOD) @Retention(value=RUNTIME) public @interface ArgumentMatcher
@ArgumentMatcher
public static <T> T same(T sameAs) {
ArgumentMatcherRepository.registerArgumentMatcher(new SameArgumentMatcher(sameAs));
return null;
}
By annotating the method with this annotation, it can now be used inline in a mock invocation to register the
argument matcher. For example:
myMock.aMethod(1, "test", same(myObject));
Copyright © 2016. All Rights Reserved.