Closed GoogleCodeExporter closed 8 years ago
Hey,
Bear in mind that Mockito.any() (and similar methods) do not create matchers.
Those
are not factory methods.
Matcher m = ...; //matcher creation
mock.foo(argThat(m)); //using the matcher via 'argThat' method.
Honestly, I hate the way arg matchers are implemented. In dynamic languages it
is way
easier & elegant to do it. Unfortunately, we use java and we have to hack
around :)
Using matcher methods is order sensitive because of java evaluation sequence.
If you find a better way to implement matchers in Mockito - hack on the
sources. If
you have suggestions on the updates to javadocs - please tell me where & what
needs
to be added.
Thanks!
PS.
Instead of:
(Map<String,Object>) Mockito.any()
you can do:
(Map) any() or anyMap()
and deprecated warnings in the test.
Original comment by szcze...@gmail.com
on 12 Apr 2010 at 9:19
Original comment by szcze...@gmail.com
on 24 May 2010 at 5:45
This issue was closed by revision r2014.
Original comment by szcze...@gmail.com
on 14 Jun 2010 at 9:02
Original comment by szcze...@gmail.com
on 3 Jul 2011 at 12:43
Original comment by brice.du...@gmail.com
on 2 Dec 2012 at 10:21
Original issue reported on code.google.com by
ulrich.h...@gmail.com
on 12 Apr 2010 at 7:17