use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.
the class GenericIdpSignInHandlerTest 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 GenericIdpSignInHandler((Application) ApplicationProvider.getApplicationContext()));
// See https://github.com/firebase/FirebaseUI-Android/issues/1805
Map<String, String> customParams = new HashMap<>();
customParams.put("prompt", "select_account");
AuthUI.IdpConfig config = new AuthUI.IdpConfig.MicrosoftBuilder().setScopes(Arrays.asList(SCOPE)).setCustomParameters(customParams).build();
mHandler.initializeForTesting(config);
mHandler.getOperation().observeForever(mResponseObserver);
}
use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.
the class PhoneProviderResponseHandlerTest method setupAnonymousUpgrade.
private void setupAnonymousUpgrade() {
FlowParameters testParams = TestHelper.getFlowParameters(Collections.singletonList(PhoneAuthProvider.PROVIDER_ID), true);
mHandler.initializeForTesting(testParams, mMockAuth, null);
when(mMockAuth.getCurrentUser()).thenReturn(mMockUser);
when(mMockUser.isAnonymous()).thenReturn(true);
}
use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.
the class AnonymousSignInHandlerTest method setUp.
@Before
public void setUp() {
TestHelper.initialize();
MockitoAnnotations.initMocks(this);
FlowParameters testParams = TestHelper.getFlowParameters(new ArrayList<String>());
mMockActivity = TestHelper.getHelperActivity(testParams);
mHandler = new AnonymousSignInHandler((Application) ApplicationProvider.getApplicationContext());
mHandler.init(testParams);
mHandler.mAuth = mMockAuth;
}
use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.
the class SmartLockHandlerTest method setUp.
@Before
public void setUp() {
TestHelper.initialize();
MockitoAnnotations.initMocks(this);
mHandler = new SmartLockHandler((Application) ApplicationProvider.getApplicationContext());
FlowParameters testParams = TestHelper.getFlowParameters(Collections.singletonList(EmailAuthProvider.PROVIDER_ID));
mHandler.initializeForTesting(testParams, mMockAuth, mMockCredentials);
mHandler.setResponse(new IdpResponse.Builder(new User.Builder(EmailAuthProvider.PROVIDER_ID, TestConstants.EMAIL).build()).build());
}
use of com.firebase.ui.auth.data.model.FlowParameters in project FirebaseUI-Android by firebase.
the class WelcomeBackPasswordHandlerTest method setupAnonymousUpgrade.
private void setupAnonymousUpgrade() {
// enableAnonymousUpgrade must be set to true
FlowParameters testParams = TestHelper.getFlowParameters(Collections.singletonList(EmailAuthProvider.PROVIDER_ID), /* enableAnonymousUpgrade */
true);
mHandler.initializeForTesting(testParams, mMockAuth, mMockCredentials);
// Mock isAnonymous() to return true so canUpgradeAnonymous will return true
when(mUser.isAnonymous()).thenReturn(true);
when(mMockAuth.getCurrentUser()).thenReturn(mUser);
}
Aggregations