7

As a part of unit test I need to mock a void function(Which accept any non-primitive paramter. e.g. MAP) call with any argument.

mockObj.myMethod(<anyObject>)

Is it possible to do this with EasyMock?

Marvo
  • 17,845
  • 8
  • 50
  • 74
shantanu
  • 1,748
  • 3
  • 19
  • 34

1 Answers1

7

Use either of the anyObject methods: anyObject() or anyObject(T)

So

 expect(mockObj.myMethod(anyObject()));

See the Flexible Expectations with Argument Matchers section of the documentation

John B
  • 32,493
  • 6
  • 77
  • 98