Uh oh!
There was an error while loading. Please reload this page.
[shared_preferences] Convert legacy tests to Kotlin - #12193
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the LegacySharedPreferencesTest class from Java to Kotlin. The review feedback suggests removing redundant @Mock annotations, as the mocks are already manually initialized in the setup method, and correcting the argument order in several assertEquals assertions where the expected and actual values are swapped.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…/src/test/kotlin/io/flutter/plugins/sharedpreferences/LegacySharedPreferencesTest.kt Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…/src/test/kotlin/io/flutter/plugins/sharedpreferences/LegacySharedPreferencesTest.kt Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
| val flutterData: Map<String, Any> = plugin.getAll("flutter.", null) | ||
| assertEquals(5, flutterData.size) | ||
| assertEquals("Java", flutterData["flutter.Language"]) |
There was a problem hiding this comment.
Very strange; the menu option very clearly said "Convert Java to Kotlin" 🙃
Fixed throughout the file.
tarrinneal
left a comment
There was a problem hiding this comment.
lg, might be worth changing all the "java" to "kotlin" but it doesn't really matter
Uh oh!
There was an error while loading. Please reload this page.
…r#189509) flutter/packages@ad2eab1...9f95026 2026-07-15 katelovett@google.com [google_fonts] Extract the config class to its own file (flutter/packages#12202) 2026-07-14 jessiewong401@gmail.com Update All Flutter Android Example Apps to 3.47 Template Versions (flutter/packages#12195) 2026-07-14 engine-flutter-autoroll@skia.org Roll Flutter from cf9e8af to 846664b (24 revisions) (flutter/packages#12200) 2026-07-14 oss@simonbinder.eu [go_router_builder] Support analyzer 13 (flutter/packages#12189) 2026-07-14 stuartmorgan@google.com [shared_preferences] Convert legacy tests to Kotlin (flutter/packages#12193) 2026-07-13 dkwingsmt@users.noreply.github.com [material_ui, cupertino_ui] Migrate `@macro`s that are defined in Material and used in Cupertino (flutter/packages#12197) 2026-07-13 dkwingsmt@users.noreply.github.com [material_ui, cupertino_ui] Add `#region` to example files to remove license headers (flutter/packages#12170) 2026-07-13 73310711+shrabanti722@users.noreply.github.com [video_player] Implement screen auto-lock control for video playback (flutter/packages#11225) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com 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
Converts the legacy tests for
shared_preferences_androidto Kotlin, so that the plugin is now consistently using Kotlin, instead of a mix of Java and Kotlin.As with the non-test PR, this was a first-pass conversion via the Android Studio auto-converted, followed by manual fixup, followed by running it through a local Gemini review focusing on making the Kotlin more idiomatic.
Follow-up to #12139
Part of flutter/flutter#188630
Pre-Review Checklist
[shared_preferences]///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩↩2