AuthUI { @NonNull public SignInIntentBuilder createSignInIntentBuilder() { return new SignInIntentBuilder(); } private  AuthUI(FirebaseApp app); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @NonNull static Context getApplicationContext(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) static void setApplicationContext(@NonNull Context context); @NonNull static AuthUI getInstance(); @NonNull static AuthUI getInstance(@NonNull FirebaseApp app); static boolean canHandleIntent(@NonNull Intent intent); @StyleRes static int getDefaultTheme(); @NonNull Task<AuthResult> silentSignIn(@NonNull Context context,
                                         @NonNull List<IdpConfig> configs); @NonNull Task<Void> signOut(@NonNull Context context); @NonNull Task<Void> delete(@NonNull Context context); @NonNull SignInIntentBuilder createSignInIntentBuilder(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    static final String TAG; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    static final String ANONYMOUS_PROVIDER; static final String EMAIL_LINK_PROVIDER; static final String MICROSOFT_PROVIDER; static final String YAHOO_PROVIDER; static final String APPLE_PROVIDER; static final int NO_LOGO; static final Set<String> SUPPORTED_PROVIDERS; static final Set<String> SUPPORTED_OAUTH_PROVIDERS; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    static final Set<String> SOCIAL_PROVIDERS; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    static final String UNCONFIGURED_CONFIG_VALUE; }
@Test public void testCreateStartIntent_shouldHaveEmailAsDefaultProvider() { FlowParameters flowParameters = mAuthUi .createSignInIntentBuilder() .build() .getParcelableExtra(ExtraConstants.FLOW_PARAMS); assertEquals(1, flowParameters.providers.size()); assertEquals(EmailAuthProvider.PROVIDER_ID, flowParameters.providers.get(0).getProviderId()); }
@Test(expected = IllegalArgumentException.class) public void testCreateStartIntent_shouldOnlyAllowOneInstanceOfAnIdp() { SignInIntentBuilder startIntent = mAuthUi.createSignInIntentBuilder(); startIntent.setAvailableProviders(Arrays.asList( new IdpConfig.EmailBuilder().build(), new IdpConfig.EmailBuilder().build())); }
@Test(expected = NullPointerException.class) public void testCreatingStartIntent_withNullTos_expectEnforcesNonNullTosUrl() { SignInIntentBuilder startIntent = mAuthUi.createSignInIntentBuilder(); startIntent.setTosAndPrivacyPolicyUrls(null, TestConstants.PRIVACY_URL); }
@Test(expected = NullPointerException.class) public void testCreatingStartIntent_withNullPp_expectEnforcesNonNullPpUrl() { SignInIntentBuilder startIntent = mAuthUi.createSignInIntentBuilder(); startIntent.setTosAndPrivacyPolicyUrls(TestConstants.TOS_URL, null); }
@Test(expected = IllegalStateException.class) public void testCreatingStartIntent_withOnlyAnonymousProvider_expectIllegalStateException() { SignInIntentBuilder startIntent = mAuthUi.createSignInIntentBuilder(); startIntent.setAvailableProviders(Arrays.asList(new IdpConfig.AnonymousBuilder().build())); }
@Test public void testCustomAuthMethodPickerLayout() { AuthMethodPickerLayout customLayout = new AuthMethodPickerLayout.Builder(R.layout.fui_phone_layout) .setAnonymousButtonId(123) .build(); FlowParameters flowParameters = mAuthUi .createSignInIntentBuilder() .setAuthMethodPickerLayout(customLayout) .build() .getParcelableExtra(ExtraConstants.FLOW_PARAMS); assert flowParameters.authMethodPickerLayout != null; assertEquals(customLayout.getMainLayout(), flowParameters.authMethodPickerLayout.getMainLayout()); }