mockito anyList of a given size

后端 未结 4 439
囚心锁ツ
囚心锁ツ 2021-01-01 08:53

I\'m verifying with mockito that a method has been called. The method:

public void createButtons(final List
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-01 09:18

    Hamcrest provides a simpler way.

    verify(mock).addAll(argThat(IsCollectionWithSize.hasSize(4)));
    

提交回复
热议问题