2222import com .firebase .ui .auth .testhelpers .TestHelper ;
2323import com .firebase .ui .auth .ui .HelperActivityBase ;
2424import com .firebase .ui .auth .ui .idp .WelcomeBackIdpPrompt ;
25+ import com .firebase .ui .auth .util .ExtraConstants ;
2526import com .firebase .ui .auth .util .data .AuthOperationManager ;
2627import com .firebase .ui .auth .viewmodel .email .EmailLinkSignInHandler ;
2728import com .google .firebase .auth .AuthCredential ;
@@ -69,8 +70,6 @@ public class GenericIdpSignInHandlerTest {
6970 private static final String DISPLAY_NAME = "displayName" ;
7071 private static final String EMAIL = "email" ;
7172 private static final String SCOPE = "scope" ;
72- private static final String CUSTOM_PARAMETER_KEY = "customParameterKey" ;
73- private static final String CUSTOM_PARAMETER_VALUE = "customParameterValue" ;
7473
7574 private GenericIdpSignInHandler mHandler ;
7675
@@ -99,8 +98,9 @@ public void setUp() {
9998 mHandler = new GenericIdpSignInHandler (
10099 (Application ) ApplicationProvider .getApplicationContext ());
101100
101+ // See https://github.com/firebase/FirebaseUI-Android/issues/1805
102102 Map <String , String > customParams = new HashMap <>();
103- customParams .put (CUSTOM_PARAMETER_KEY , CUSTOM_PARAMETER_VALUE );
103+ customParams .put ("prompt" , "select_account" );
104104
105105 AuthUI .IdpConfig config
106106 = new AuthUI .IdpConfig .MicrosoftBuilder ()
@@ -125,6 +125,11 @@ public void testStartSignIn_normalSignInFlow_expectSuccess() {
125125
126126 assertThat (providerCaptor .getValue ().getProviderId ()).isEqualTo (MICROSOFT_PROVIDER );
127127
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+
128133 InOrder inOrder = inOrder (mResponseObserver );
129134 inOrder .verify (mResponseObserver )
130135 .onChanged (argThat (ResourceMatchers .<IdpResponse >isLoading ()));
0 commit comments