[shared_preferences] Convert legacy tests to Kotlin#12193
Open
stuartmorgan-g wants to merge 11 commits into
Open
[shared_preferences] Convert legacy tests to Kotlin#12193stuartmorgan-g wants to merge 11 commits into
stuartmorgan-g wants to merge 11 commits into
Conversation
Contributor
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.
…/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>
tarrinneal
reviewed
Jul 13, 2026
| val flutterData: Map<String, Any> = plugin.getAll("flutter.", null) | ||
|
|
||
| assertEquals(5, flutterData.size) | ||
| assertEquals("Java", flutterData["flutter.Language"]) |
tarrinneal
approved these changes
Jul 13, 2026
tarrinneal
left a comment
Contributor
There was a problem hiding this comment.
lg, might be worth changing all the "java" to "kotlin" but it doesn't really matter
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.
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