我正在尝试运行此行:
verify(imagesSorterSpy, atLeast(2)).sortImages(anyList(), null);
验证这个方法是用 null 作为第二个参数调用的。
但我收到此错误:
rg.mockito.exceptions.misusing.InvalidUseOfMatchersException:
Invalid use of argument matchers!
2 matchers expected, 1 recorded:
This exception may occur if matchers are combined with raw values:
//incorrect:
someMethod(anyObject(), "raw String");
When using matchers, all arguments have to be provided by matchers.
For example:
//correct:
someMethod(anyObject(), eq("String by matcher"));
如何验证使用 null 作为第二个参数的调用?