Repository navigation
[google_sign_in] Convert unit tests to Kotlin - #13000
Conversation
There was a problem hiding this comment.
Code Review
This pull request converts the GoogleSignInTest suite from Java to Kotlin, adopting mockito-kotlin for more idiomatic mocking, and removes the ResultCompat helper class. The review feedback focuses on making the Kotlin code more idiomatic, such as importing JUnit assertion functions directly to reduce boilerplate, using read-only lists instead of mutable lists where mutation is not required, and utilizing doThrow directly from mockito-kotlin.
| val scopes = mutableListOf("scope1", "scope1") | ||
| val params = PlatformAuthorizationRequest(scopes) |
There was a problem hiding this comment.
Use listOf instead of mutableListOf since the list of scopes is read-only and does not need to be mutated.
| val scopes = mutableListOf("scope1", "scope1") | |
| val params = PlatformAuthorizationRequest(scopes) | |
| val scopes = listOf("scope1", "scope1") | |
| val params = PlatformAuthorizationRequest(scopes) |
References
- The repository style guide requires following the relevant style guides for each language, which includes Kotlin coding conventions and idioms. (link)
|
Changelog/version override: this is a test-only change; the failure is a false positive from having touched a gradle.kts file which isn't always test-only. |
|
Let me know if you want me to take the PR from here. |
flutter/packages@d8d9e97...a1ed23c 2026-10-13 [email protected] [material_ui] Clarify Slider labels for continuous sliders (flutter/packages#13121) 2026-10-12 [email protected] [in_app_purchase_storekit] Remove availability checks below the package minimum iOS 13 and macOS 10.15 (flutter/packages#13217) 2026-10-12 [email protected] [google_sign_in] Convert unit tests to Kotlin (flutter/packages#13000) 2026-10-12 [email protected] [vector_graphics_compiler] Support SVG alpha masks (mask-type="alpha") (flutter/packages#13025) 2026-10-11 [email protected] [camera_platform_interface] Add zero-shutter-lag API (flutter/packages#12996) 2026-10-10 [email protected] [material_ui] Ensure textScaler is taken into account for SnackBar action overflow (flutter/packages#12737) 2026-10-10 [email protected] [material_ui] Add more 0x0 size tests part 14 (flutter/packages#13107) 2026-10-10 [email protected] [cupertino_ui] Fix CupertinoPicker throwing when disposed during the tap-to-select animation (flutter/packages#13012) 2026-10-09 [email protected] Roll Flutter (stable) from 5fc3468 to abaf9c5 (3 revisions) (flutter/packages#13186) 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
flutter/packages@d8d9e97...a1ed23c 2026-10-13 [email protected] [material_ui] Clarify Slider labels for continuous sliders (flutter/packages#13121) 2026-10-12 [email protected] [in_app_purchase_storekit] Remove availability checks below the package minimum iOS 13 and macOS 10.15 (flutter/packages#13217) 2026-10-12 [email protected] [google_sign_in] Convert unit tests to Kotlin (flutter/packages#13000) 2026-10-12 [email protected] [vector_graphics_compiler] Support SVG alpha masks (mask-type="alpha") (flutter/packages#13025) 2026-10-11 [email protected] [camera_platform_interface] Add zero-shutter-lag API (flutter/packages#12996) 2026-10-10 [email protected] [material_ui] Ensure textScaler is taken into account for SnackBar action overflow (flutter/packages#12737) 2026-10-10 [email protected] [material_ui] Add more 0x0 size tests part 14 (flutter/packages#13107) 2026-10-10 [email protected] [cupertino_ui] Fix CupertinoPicker throwing when disposed during the tap-to-select animation (flutter/packages#13012) 2026-10-09 [email protected] Roll Flutter (stable) from 5fc3468 to abaf9c5 (3 revisions) (flutter/packages#13186) 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
Converts
google_sign_in_androidnative unit tests from Java to Kotlin.Similar to my other conversions, the process was:
mockito-kotlinto make the mocking much less verbose and complexThis also removes the test-only bridge code that allowed using
Resultin Java tests, now that it is no longer necessary.Does not include any changes to production code.
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