Pull to refresh

Comments 8

Как по мне сильно не хватает описания spy моков. Ну и соответственно отличий от обычного.
UFO landed and left these words here
тогда и статья не по Mockito, а по Mockito.mock
UFO landed and left these words here
понял, вы комментировали вот эту часть: «spy моков».
Внёс корректировку,
BaseMatcher<byte[]> arrayStartingWithA
вместо простого
BaseMatcher arrayStartingWithA
Это позволило убрать (byte[]) перед argThat, и теперь строчка выглядит так:
.write(argThat(arrayStartingWithA), eq(0), eq(1));
UFO landed and left these words here
Mockito.verify(mock_object).callMethod(Matchers.eq(concrete_object));

если будет другой объект то тест упадет с ошибкой: Argument(s) are different!
если вызова не было: Wanted but not invoked:

Sign up to leave a comment.

Articles