Search in sources :

Example 26 with FlowParameters

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

the class EmailLinkSendEmailHandlerTest method setUp.

@Before
public void setUp() {
    TestHelper.initialize();
    MockitoAnnotations.initMocks(this);
    mHandler = new EmailLinkSendEmailHandler((Application) ApplicationProvider.getApplicationContext());
    FlowParameters testParams = TestHelper.getFlowParameters(new ArrayList<String>());
    mHandler.initializeForTesting(testParams, mMockAuth, null);
    mPersistenceManager = EmailLinkPersistenceManager.getInstance();
}
Also used : FlowParameters(com.firebase.ui.auth.data.model.FlowParameters) EmailLinkSendEmailHandler(com.firebase.ui.auth.viewmodel.email.EmailLinkSendEmailHandler) Application(android.app.Application) Before(org.junit.Before)

Example 27 with FlowParameters

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

the class GenericIdpAnonymousUpgradeLinkingHandlerTest method setUp.

@Before
public void setUp() {
    TestHelper.initialize();
    MockitoAnnotations.initMocks(this);
    FlowParameters testParams = TestHelper.getFlowParameters(Arrays.asList(MICROSOFT_PROVIDER, GoogleAuthProvider.PROVIDER_ID), /* enableAnonymousUpgrade= */
    true);
    mMockActivity = TestHelper.getHelperActivity(testParams);
    mHandler = spy(new GenericIdpAnonymousUpgradeLinkingHandler((Application) ApplicationProvider.getApplicationContext()));
    Map<String, String> customParams = new HashMap<>();
    customParams.put(CUSTOM_PARAMETER_KEY, CUSTOM_PARAMETER_VALUE);
    AuthUI.IdpConfig config = new AuthUI.IdpConfig.MicrosoftBuilder().setScopes(Arrays.asList(SCOPE)).setCustomParameters(customParams).build();
    mHandler.initializeForTesting(config);
    mHandler.getOperation().observeForever(mResponseObserver);
}
Also used : FlowParameters(com.firebase.ui.auth.data.model.FlowParameters) HashMap(java.util.HashMap) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) GenericIdpAnonymousUpgradeLinkingHandler(com.firebase.ui.auth.data.remote.GenericIdpAnonymousUpgradeLinkingHandler) AuthUI(com.firebase.ui.auth.AuthUI) 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