-1

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 ?

Sue
  • 2,380
  • 2
  • 10
  • 11

2 Answers2

0

This should work. Replace MyObject with your Object

Matchers.<List<MyObject>>any()
pvpkiran
  • 25,582
  • 8
  • 87
  • 134
0

To test with specific values of a list of object :

Matchers.eq(T value)

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

Sue
  • 2,380
  • 2
  • 10
  • 11