Search code examples
listmockitomatcher

Mockito Matchers List<Object>


I need to create a mockito that test if he gets a list of Object in entrance.

But I find only Matchers.anyList. I need to specify a List.

Can anyone help plz ?


Solution

  • To test with specific values of a list of object :

    Matchers.eq(T value)

    and you should generate equals and hashCode() in the Object