Open GoogleCodeExporter opened 9 years ago
i am getting this error only in IntelliJ:Misplaced argument matcher detected
here:
-> at
com.beachbody.pioneer.service.mediaBuy.MockTest.staticMockingExampleClassTest(Mo
ckTest.java:51)
You cannot use argument matchers outside of verification or stubbing.
Examples of correct usage of argument matchers:
when(mock.get(anyInt())).thenReturn(null);
doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());
verify(mock).someMethod(contains("foo"))
Also, this error might show up because you use argument matchers with methods
that cannot be mocked.
Following methods *cannot* be stubbed/verified:
final/private/equals()/hashCode().
Original comment by goldbric...@gmail.com
on 28 Nov 2014 at 7:35
Attachments:
Original issue reported on code.google.com by
goldbric...@gmail.com
on 28 Nov 2014 at 7:28