ssacher-tgm / mockito

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

Error for noArgumentValueWasCaptured gives invalid suggestion #202

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Here's the code from Reporter:

public void noArgumentValueWasCaptured() {
        throw new MockitoException(join(
                "No argument value was captured!",
                "You might have forgotten to use argument.capture() in verify()...",
                "...or you used capture() in stubbing but stubbed method was not called.",
                "Be aware that it is recommended to use capture() only with verify()",
                "",
                "Examples of correct argument capturing:",
                "    Argument<Person> argument = new Argument<Person>();",
                "    verify(mock).doSomething(argument.capture());",
                "    assertEquals(\"John\", argument.getValue().getName());",
                ""
                ));

The example should be something like this I believe:

ArgumentCaptor<Person> argument = ArgumentCaptor.forClass(Person.class);

Original issue reported on code.google.com by willh...@google.com on 1 Jul 2010 at 12:11

GoogleCodeExporter commented 8 years ago
Ouch, thanks a lot for reporting this!!! I'm fixing it right away.

Original comment by szcze...@gmail.com on 10 Jul 2010 at 1:01

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r2040.

Original comment by szcze...@gmail.com on 10 Jul 2010 at 1:04

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 3 Jul 2011 at 12:43