Search in sources :

Example 11 with FlowParameters

use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.

the class WelcomeBackPasswordHandlerTest method setUp.

@Before
public void setUp() {
    TestHelper.initialize();
    MockitoAnnotations.initMocks(this);
    mHandler = new WelcomeBackPasswordHandler((Application) ApplicationProvider.getApplicationContext());
    FlowParameters testParams = TestHelper.getFlowParameters(Collections.singletonList(EmailAuthProvider.PROVIDER_ID));
    mHandler.initializeForTesting(testParams, mMockAuth, mMockCredentials);
}
Also used : FlowParameters(com.firebase.ui.auth.data.model.FlowParameters) WelcomeBackPasswordHandler(com.firebase.ui.auth.viewmodel.email.WelcomeBackPasswordHandler) Application(android.app.Application) Before(org.junit.Before)

Example 12 with FlowParameters

use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.

the class AuthUITest method testCreatingStartIntentWithDefaultProvider.

@Test
public void testCreatingStartIntentWithDefaultProvider() {
    FlowParameters flowParameters = mAuthUi.createSignInIntentBuilder().setAvailableProviders(Arrays.asList(new IdpConfig.EmailBuilder().build(), new IdpConfig.GoogleBuilder().build(), new IdpConfig.FacebookBuilder().build())).setDefaultProvider(new IdpConfig.FacebookBuilder().build()).build().getParcelableExtra(ExtraConstants.FLOW_PARAMS);
    assertEquals(new IdpConfig.FacebookBuilder().build(), flowParameters.defaultProvider);
    assertFalse(flowParameters.shouldShowProviderChoice());
    assertEquals(new IdpConfig.FacebookBuilder().build(), flowParameters.getDefaultOrFirstProvider());
}
Also used : FlowParameters(com.firebase.ui.auth.data.model.FlowParameters) Test(org.junit.Test)

Example 13 with FlowParameters

use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.

the class LinkingSocialProviderResponseHandlerTest method setupAnonymousUpgrade.

private void setupAnonymousUpgrade() {
    FlowParameters testParams = TestHelper.getFlowParameters(Collections.singletonList(GoogleAuthProvider.PROVIDER_ID), true);
    mHandler.initializeForTesting(testParams, mMockAuth, null);
    when(mMockAuth.getCurrentUser()).thenReturn(mMockUser);
    when(mMockUser.isAnonymous()).thenReturn(true);
    AuthOperationManager.getInstance().mScratchAuth = mScratchMockAuth;
}
Also used : FlowParameters(com.firebase.ui.auth.data.model.FlowParameters)

Example 14 with FlowParameters

use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.

the class RecoverPasswordHandlerTest method setUp.

@Before
public void setUp() {
    TestHelper.initialize();
    MockitoAnnotations.initMocks(this);
    mHandler = new RecoverPasswordHandler((Application) ApplicationProvider.getApplicationContext());
    FlowParameters testParams = TestHelper.getFlowParameters(Collections.singletonList(EmailAuthProvider.PROVIDER_ID));
    mHandler.initializeForTesting(testParams, mMockAuth, null);
    mPasswordResetSettings = ActionCodeSettings.newBuilder().setAndroidPackageName("com.firebase.uidemo", true, null).setHandleCodeInApp(true).setUrl("https://google.com").build();
}
Also used : RecoverPasswordHandler(com.firebase.ui.auth.viewmodel.email.RecoverPasswordHandler) FlowParameters(com.firebase.ui.auth.data.model.FlowParameters) Application(android.app.Application) Before(org.junit.Before)

Example 15 with FlowParameters

use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.

the class SocialProviderResponseHandlerTest method setUp.

@Before
public void setUp() {
    TestHelper.initialize();
    MockitoAnnotations.initMocks(this);
    mHandler = new SocialProviderResponseHandler((Application) ApplicationProvider.getApplicationContext());
    FlowParameters testParams = TestHelper.getFlowParameters(AuthUI.SUPPORTED_PROVIDERS);
    mHandler.initializeForTesting(testParams, mMockAuth, null);
}
Also used : SocialProviderResponseHandler(com.firebase.ui.auth.viewmodel.idp.SocialProviderResponseHandler) FlowParameters(com.firebase.ui.auth.data.model.FlowParameters) Application(android.app.Application) Before(org.junit.Before)

Aggregations

FlowParameters (com.firebase.ui.auth.data.model.FlowParameters)27 Before (org.junit.Before)10 Application (android.app.Application)9 Test (org.junit.Test)4 AuthUI (com.firebase.ui.auth.AuthUI)3 OAuthProvider (com.google.firebase.auth.OAuthProvider)3 HashMap (java.util.HashMap)3 TextView (android.widget.TextView)2 FirebaseAuthAnonymousUpgradeException (com.firebase.ui.auth.FirebaseAuthAnonymousUpgradeException)2 FirebaseUiException (com.firebase.ui.auth.FirebaseUiException)2 IdpResponse (com.firebase.ui.auth.IdpResponse)2 UserCancellationException (com.firebase.ui.auth.data.model.UserCancellationException)2 SocialProviderResponseHandler (com.firebase.ui.auth.viewmodel.idp.SocialProviderResponseHandler)2 Intent (android.content.Intent)1 ImageView (android.widget.ImageView)1 NonNull (androidx.annotation.NonNull)1 Nullable (androidx.annotation.Nullable)1 RestrictTo (androidx.annotation.RestrictTo)1 VisibleForTesting (androidx.annotation.VisibleForTesting)1 ConstraintLayout (androidx.constraintlayout.widget.ConstraintLayout)1