ssacher-tgm / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

Introduce 'delegating' answer to allow spying on proxied objects #145

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
For example:

IMethods mock = mock(IMethods.class, new Answer() {
  public Object answer(InvocationOnMock invocation) throws Throwable {
                return invocation.getMethod().invoke(delegate,
invocation.getArguments());
            }
        });

This allows spying some 'weird' objects, like proxied objects. Can be
helpful for legacy code (see lengthy discussion at the end of issue 29).

Original issue reported on code.google.com by szcze...@gmail.com on 12 Nov 2009 at 6:48

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 14 Feb 2010 at 9:57

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 7 Nov 2010 at 12:45

GoogleCodeExporter commented 8 years ago
Also see issue 275 and issue 280

Original comment by brice.du...@gmail.com on 5 Mar 2012 at 4:24

GoogleCodeExporter commented 8 years ago
Issue 280 has been merged into this issue.

Original comment by brice.du...@gmail.com on 7 Mar 2012 at 11:52

GoogleCodeExporter commented 8 years ago
Fixed in revision 6daa4d19a08c 
Thx to José Paumard for contributing the code.

Original comment by brice.du...@gmail.com on 9 Mar 2012 at 11:01

GoogleCodeExporter commented 8 years ago
Issue 275 has been merged into this issue.

Original comment by brice.du...@gmail.com on 9 Mar 2012 at 11:03

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 13 May 2012 at 3:32

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 3 Jun 2012 at 2:06