22
22
import com .firebase .ui .auth .testhelpers .TestHelper ;
23
23
import com .firebase .ui .auth .ui .HelperActivityBase ;
24
24
import com .firebase .ui .auth .ui .idp .WelcomeBackIdpPrompt ;
25
+ import com .firebase .ui .auth .util .ExtraConstants ;
25
26
import com .firebase .ui .auth .util .data .AuthOperationManager ;
26
27
import com .firebase .ui .auth .viewmodel .email .EmailLinkSignInHandler ;
27
28
import com .google .firebase .auth .AuthCredential ;
@@ -69,8 +70,6 @@ public class GenericIdpSignInHandlerTest {
69
70
private static final String DISPLAY_NAME = "displayName" ;
70
71
private static final String EMAIL = "email" ;
71
72
private static final String SCOPE = "scope" ;
72
- private static final String CUSTOM_PARAMETER_KEY = "customParameterKey" ;
73
- private static final String CUSTOM_PARAMETER_VALUE = "customParameterValue" ;
74
73
75
74
private GenericIdpSignInHandler mHandler ;
76
75
@@ -99,8 +98,9 @@ public void setUp() {
99
98
mHandler = new GenericIdpSignInHandler (
100
99
(Application ) ApplicationProvider .getApplicationContext ());
101
100
101
+ // See https://github.com/firebase/FirebaseUI-Android/issues/1805
102
102
Map <String , String > customParams = new HashMap <>();
103
- customParams .put (CUSTOM_PARAMETER_KEY , CUSTOM_PARAMETER_VALUE );
103
+ customParams .put ("prompt" , "select_account" );
104
104
105
105
AuthUI .IdpConfig config
106
106
= new AuthUI .IdpConfig .MicrosoftBuilder ()
@@ -125,6 +125,11 @@ public void testStartSignIn_normalSignInFlow_expectSuccess() {
125
125
126
126
assertThat (providerCaptor .getValue ().getProviderId ()).isEqualTo (MICROSOFT_PROVIDER );
127
127
128
+ HashMap <String , String > customArgs = (HashMap <String , String >) mHandler .getArguments ().getParams ()
129
+ .getSerializable (ExtraConstants .GENERIC_OAUTH_CUSTOM_PARAMETERS );
130
+ assertThat (customArgs ).isNotNull ();
131
+ assertThat (customArgs ).hasSize (1 );
132
+
128
133
InOrder inOrder = inOrder (mResponseObserver );
129
134
inOrder .verify (mResponseObserver )
130
135
.onChanged (argThat (ResourceMatchers .<IdpResponse >isLoading ()));
0 commit comments