I have a question what about Argument Matcher.
class A(){
public B method(Class T,String str){}
}
I Stub the method and want pass the method.but .
org.mockito.exceptions.misusing.InvalidUseOfMatchersException: Invalid use of argument matchers!
A a = new A();
B b = new B();
Mockito.doReturn(b).when(a).method(argThat(new IsClass)), "111");
Class IsClass:
class IsClass extends ArgumentMatcher<Class> {
public boolean matches(Object obj) {
return true;
}
}
So, how should I do, can pass this method.Thankyou.