If I'm calling "Class.getDeclaredMethod()" on a class and method, and I have to
specify parameters for that method, but one or more of the parameter instances
I have are mocked objects, then the "getDeclaredMethod()" search apparently
fails, because the class of the mocked object is a subclass of the original
class. If the code calling this can know that the parameter is a mocked
object, then it can use the superclass instead. The code would have to be able
to call a method that returns true or false to indicate whether the instance is
a mocked object. Alternatively, a method that is defined to "return the
original class" of the instance could check for the Mockito-ness of the object
internally, and return the superclass instead of the class of the object.
I asked about this on the mailing list, and Szczepan said:
"There is no public API that could satisfy this. It could be added as a
new method to MockingDetails."
Original issue reported on code.google.com by
davidmic...@gmail.comon 9 May 2014 at 9:24