Repository navigation
[shared_prferences] Adopts mockito-kotlin in tests - #13624
Merged
auto-submit[bot] merged 2 commits intoNov 11, 2026
Merged
auto-submit[bot] merged 2 commits into
auto-submit[bot] merged 2 commits into
Conversation
Adopts the `mockito-kotlin` library that has been used in other plugins' test conversions, which simplifies interacting with Mockito in Kotlin code, reducing some unnecessary test boilerplate.
Contributor
Author
|
version/changelog override: the gradle change here is test-only. |
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds the mockito-kotlin dependency to the Android build configuration and refactors LegacySharedPreferencesTest.kt to utilize Kotlin-friendly Mockito APIs (such as mock, whenever, and verify) instead of standard Java Mockito syntax. The reviewer recommended removing the redundant mockito-inline dependency, as Mockito 5.x enables the inline mock maker by default and mockito-kotlin transitively includes mockito-core 5.x.
stuartmorgan
commented
Nov 11, 2026
| /** A dummy implementation for tests for use with FakeSharedPreferences */ | ||
| private class FakeSharedPreferencesEditor | ||
| constructor(private val sharedPrefData: MutableMap<String, Any?>) : SharedPreferences.Editor { | ||
| private class FakeSharedPreferencesEditor(private val sharedPrefData: MutableMap<String, Any?>) : |
Contributor
Author
There was a problem hiding this comment.
This is just a stray IDE warning fix while I was in the IDE; constructor is redundant here.
tarrinneal
approved these changes
Nov 11, 2026
b-luk
pushed a commit
to b-luk/flutter
that referenced
this pull request
Nov 12, 2026
…r#196450) flutter/packages@653628e...14f9933 2026-11-12 [email protected] [material_ui] Fix SnackBarThemeData.lerp dropping showCloseIcon (flutter/packages#13449) 2026-11-11 [email protected] [ci] Update repo for 3.50 stable release (flutter/packages#13628) 2026-11-11 [email protected] [vector_graphics] Use font-family lists as a family with fallbacks (flutter/packages#13552) 2026-11-11 [email protected] Roll Flutter (stable) from c197ca5 to ab29120 (1647 revisions) (flutter/packages#13625) 2026-11-11 [email protected] [shared_prferences] Adopts mockito-kotlin in tests (flutter/packages#13624) 2026-11-11 [email protected] [cupertino_ui] Dim disabled CupertinoSlider controls (flutter/packages#13419) 2026-11-11 [email protected] [flutter_svg] Invalidate pending cache entries on clear and evict (flutter/packages#13595) 2026-11-11 [email protected] [cupertino_ui] Fix the tinted button's fill opacity (flutter/packages#13436) 2026-11-11 [email protected] [various] Support SVG filters (blur, offset, feMerge) (flutter/packages#11909) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopts the
mockito-kotlinlibrary that has been used in other plugins' test conversions, which simplifies interacting with Mockito in Kotlin code, reducing some unnecessary test boilerplate.