52
52
public final class TestHelper {
53
53
54
54
private static final String TAG = "TestHelper" ;
55
- private static final String DEFAULT_APP_NAME = "[DEFAULT] " ;
55
+ private static final String DEFAULT_APP_NAME = "test-app " ;
56
56
private static final String MICROSOFT_PROVIDER = "microsoft.com" ;
57
57
58
58
public static final FirebaseApp MOCK_APP ;
59
59
private static Context CONTEXT = ApplicationProvider .getApplicationContext ();
60
60
61
-
62
61
static {
63
62
FirebaseApp app = mock (FirebaseApp .class );
64
63
when (app .get (eq (FirebaseAuth .class ))).thenReturn (mock (FirebaseAuth .class ));
@@ -90,7 +89,7 @@ private static void initializeApp(Context context) {
90
89
FirebaseApp .initializeApp (context , new FirebaseOptions .Builder ()
91
90
.setApiKey ("fake" )
92
91
.setApplicationId ("fake" )
93
- .build ());
92
+ .build (), DEFAULT_APP_NAME );
94
93
}
95
94
96
95
private static void initializeProviders () {
@@ -125,14 +124,14 @@ public static FlowParameters getFlowParameters(Collection<String> providerIds) {
125
124
}
126
125
127
126
public static FlowParameters getFlowParameters (Collection <String > providerIds ,
128
- boolean enableAnonymousUpgrade ) {
127
+ boolean enableAnonymousUpgrade ) {
129
128
return getFlowParameters (providerIds , enableAnonymousUpgrade , null , false );
130
129
}
131
130
132
131
public static FlowParameters getFlowParameters (Collection <String > providerIds ,
133
- boolean enableAnonymousUpgrade ,
134
- AuthMethodPickerLayout customLayout ,
135
- boolean hasDefaultEmail ) {
132
+ boolean enableAnonymousUpgrade ,
133
+ AuthMethodPickerLayout customLayout ,
134
+ boolean hasDefaultEmail ) {
136
135
List <IdpConfig > idpConfigs = new ArrayList <>();
137
136
for (String providerId : providerIds ) {
138
137
switch (providerId ) {
@@ -151,14 +150,15 @@ public static FlowParameters getFlowParameters(Collection<String> providerIds,
151
150
case EMAIL_LINK_PROVIDER :
152
151
idpConfigs .add (new IdpConfig .EmailBuilder ().enableEmailLinkSignIn ()
153
152
.setActionCodeSettings (ActionCodeSettings .newBuilder ().setUrl ("URL" )
154
- .setHandleCodeInApp (true ).build ()).build ());
153
+ .setHandleCodeInApp (true ).build ())
154
+ .build ());
155
155
break ;
156
156
case EmailAuthProvider .PROVIDER_ID :
157
- if (hasDefaultEmail ) { idpConfigs .add (new IdpConfig .EmailBuilder ()
157
+ if (hasDefaultEmail ) {
158
+ idpConfigs .add (new IdpConfig .EmailBuilder ()
158
159
.setDefaultEmail (TestConstants .EMAIL )
159
160
.build ());
160
- } else
161
- {
161
+ } else {
162
162
idpConfigs .add (new IdpConfig .EmailBuilder ().build ());
163
163
}
164
164
break ;
0 commit comments