0
"널 (null)"PARAM 불려 어떻게 확인할 수 있습니다스파이가 나는이 줄을 실행하기 위해 노력하고있어
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를 사용해 호출을 확인할 수 있습니까?
에서이다. 명시 적 matchers를 사용할 때는 스텁의 모든 인수에 사용해야합니다. – Brice
anyList()를 비어 있지 않은 목록이나 2보다 큰 목록으로 어떻게 제한 할 수 있습니까? –