Replace mockito-android mock maker implementation with dexmaker-mockito-inline#3792
Replace mockito-android mock maker implementation with dexmaker-mockito-inline#3792raphw merged 1 commit intomockito:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3792 +/- ##
============================================
+ Coverage 86.50% 86.91% +0.41%
+ Complexity 3004 2997 -7
============================================
Files 343 340 -3
Lines 9099 9020 -79
Branches 1121 1105 -16
============================================
- Hits 7871 7840 -31
+ Misses 945 904 -41
+ Partials 283 276 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This looks good to me! I think a best start and we can always move to a fork if there is a need that justifies this step. Also easier to maintain and upgrade for a non-expert! |
|
Would you be able to highlight the breaking change this results in more clearly within the changelog? We still support SDK26 in our app, so run tests on that version, and I've just spent the last 6 hours banging my head against the wall trying to work out how I have broken all my instrumented tests :p |
|
@davwheat Sorry about the bad experience. Good call - I will update the release notes to more clearly state this breaking change! |
See #3789 for a previous discussion on this
For now it is probably better to just depend on dexmaker-mockito-inline . If we need more flexibility or the dexmaker project is not responsive, we can fork it in the future.
Note this means
mockito-androidis now published as an Android library (.aar instead of .jar). This also removes the graceful fallback behavior if this mock maker was included on a non-Android JVM - now invoking a Mockito API will fail with a runtime exception instead of falling back to the subclass mockmaker.I also updated the Android sections in the Javadoc appropriately
Checklist
This adds a new compile dependency for mockito-android on
com.linkedin.dexmaker:dexmaker-mockito-inlinewhich allows runtime generation of Android dex byte code, similar to Byte-Buddy on the JVM.