Google's march on shadows
For some reason, Google does not like Robolectric, they've never acknowledged that it works, or never said that it's a solution to a problem. If they ignore the solution, then that means the problem of slow running tests doesn't exist, right. They seem to feel that Robolectric detracts from Android, and so have kind of publicly given it the cold shoulder. Surreptitiously pushing it away by ignoring its existence, that is up until now.
Google has created exactly what we said before, an android.jar
file with default method implementations. This means no more stub!
errors when accessing a method. Further, they have removed all of the final
modifiers from classes, allowing mocking Frameworks to have a field day. Unfortunately, at the time of this writing it is undocumented. No surprise! I don't want to give usage steps, as while undocumented these will be changing rapidly. However, what I will say is, if Google got this right, then it means for the testing scenario described...