-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[google_sign_in] Add Android account name field as optional #8573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
1914008
Add a sign-in field to allow Android clients to explicitly specify an…
neilself bdfe492
Update the changelog.
neilself bedfeeb
Merge branch 'android_account_name' of ../flutter into android_accoun…
neilself ccd527a
Minor updates to fix broken checks/tests.
neilself 27f8b32
Fix string formatting in GoogleSignInTest.
neilself 6c71c01
Fix additional string formatting in GoogleSignInTest.
neilself 9265495
Format files that needed formatting.
neilself 97ada7f
Additional formatting fixes for java files.
neilself 596cf34
Specify NDK version according to checks.
neilself fc18808
Update GoogleSignInTest to fix a broken test.
neilself 1e57cc2
Update GoogleSignInTest.init_PassesForceAccountName() to use MockedCo…
neilself c9b1f5a
Merge branch 'main' into android_account_name
neilself 2e91e38
Fix missing import of Account.
neilself c256020
Merge remote-tracking branch 'origin/android_account_name' into andro…
neilself 923d2da
Update formatting within GoogleSignInTest.
neilself c00f5d3
Override dependencies in extension_google_sign_in_as_googleapis_auth …
neilself 80b054a
Override dependency in extension_google_sign_in_as_googleapis_auth du…
neilself 964bb35
Merge branch 'main' into android_account_name
neilself 68a2032
Override dependency in extension_google_sign_in_as_googleapis_auth/ex…
neilself 9327b58
Update version/CHANGELOG for google_sign_in_ios and extension_google_…
neilself 914829a
Merge branch 'main' into android_account_name
neilself 41e0456
Merge branch 'main' into android_account_name
neilself 802641e
Merge branch 'main' into android_account_name
neilself 6d4c314
Update isNullOrEmpty() usage to match new convention.
neilself 473b5e7
Revert changes to extension_google_sign_in_as_googleapis_auth package.
neilself c4fd24c
Minor updates to respond to PR review comments.
neilself 16438e2
Revert changes in the extension_google_sign_in_as_googleapis_auth pac…
neilself 1acd588
Revert changes in method_channel_google_sign_in.dart and its test file.
neilself 18af989
Updates the CHANGELOG for google_sign_in_android to better follow the…
neilself 99a101f
Merge branch 'main' into android_account_name
neilself 9476549
Update exception type in google_sign_in_ios_test to match new excepti…
neilself c694668
Merge branch 'main' into android_account_name
neilself 21282bd
Merge branch 'main' into android_account_name
neilself 2de2130
Merge branch 'main' into android_account_name
neilself fca4991
Update version number for google_sign_in_ios and some comment languag…
neilself baccfbb
Merge remote-tracking branch 'origin/android_account_name' into andro…
neilself 117ca4b
'Revert' changes to origin/main for google_sign_in_platform_interface…
neilself a3885ef
Update pubspec.yaml files in google_sign_in to remove dependency over…
neilself bf9c0f1
Merge branch 'main' into android_account_name
neilself 697c55d
Update formatting in Messages.java to match convention.
neilself 62e377b
Merge remote-tracking branch 'origin/android_account_name' into andro…
neilself b6dfff8
Merge branch 'main' into android_account_name
neilself b3e66a4
Update implementation dependency versions for app-facing package so t…
neilself 0438170
Merge branch 'main' into android_account_name
neilself 4df5d80
Bump SDK requirements to match deps
stuartmorgan-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update GoogleSignInTest.init_PassesForceAccountName() to use MockedCo…
…nstruction to test the account being constructed in the builder and then passed into GoogleSignInOptions. This is necessary as Account is an android class and cannot be instantiated normally in a unit test (the constructor will return null).
- Loading branch information
commit 1e57cc205b240e7bb980df41ae4042a3bc6f7e9f
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,8 @@ | |
| import org.junit.Test; | ||
| import org.mockito.ArgumentCaptor; | ||
| import org.mockito.Mock; | ||
| import org.mockito.MockedConstruction; | ||
| import org.mockito.Mockito; | ||
| import org.mockito.MockitoAnnotations; | ||
| import org.mockito.Spy; | ||
|
|
||
|
|
@@ -286,10 +288,19 @@ public void init_PassesForceCodeForRefreshTokenTrueWithServerClientIdFromResourc | |
|
|
||
| @Test | ||
| public void init_PassesForceAccountName() { | ||
| InitParams params = | ||
| buildInitParams("fakeClientId", "fakeServerClientId", "[email protected]"); | ||
| String fakeAccountName = "[email protected]"; | ||
|
|
||
| initAndAssertForceAccountName(params, "[email protected]"); | ||
| try(MockedConstruction<Account> mocked = Mockito.mockConstruction(Account.class, (mock, context) -> { | ||
| when(mock.toString()).thenReturn(fakeAccountName); | ||
| })) { | ||
| InitParams params = | ||
| buildInitParams("fakeClientId", "fakeServerClientId2", fakeAccountName); | ||
|
|
||
| initAndAssertForceAccountName(params, fakeAccountName); | ||
|
|
||
| List<Account> constructed = mocked.constructed(); | ||
| Assert.assertEquals(1, constructed.size()); | ||
| } | ||
| } | ||
|
|
||
| public void initAndAssertServerClientId(InitParams params, String serverClientId) { | ||
|
|
@@ -318,7 +329,7 @@ public void initAndAssertForceAccountName(InitParams params, String forceAccount | |
| when(mockGoogleSignIn.getClient(any(Context.class), optionsCaptor.capture())) | ||
| .thenReturn(mockClient); | ||
| plugin.init(params); | ||
| Assert.assertEquals(forceAccountName, optionsCaptor.getValue().getAccount().name); | ||
| Assert.assertEquals(forceAccountName, optionsCaptor.getValue().getAccount().toString()); | ||
| } | ||
|
|
||
| private static InitParams buildInitParams(String clientId, String serverClientId) { | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.