44
44
import java .util .ArrayList ;
45
45
import java .util .Arrays ;
46
46
import java .util .Collections ;
47
- import java .util .List ;
48
47
49
48
import static com .google .common .truth .Truth .assertThat ;
50
49
import static org .mockito .ArgumentMatchers .any ;
@@ -64,16 +63,19 @@ public class SocialProviderResponseHandlerTest {
64
63
65
64
private SocialProviderResponseHandler mHandler ;
66
65
66
+ private static final ArrayList <String > NON_GITHUB_PROVIDERS = new ArrayList <>();
67
+ static {
68
+ NON_GITHUB_PROVIDERS .addAll (AuthUI .SUPPORTED_PROVIDERS );
69
+ NON_GITHUB_PROVIDERS .remove (GithubAuthProvider .PROVIDER_ID );
70
+ }
71
+
67
72
@ Before
68
73
public void setUp () {
69
74
TestHelper .initialize ();
70
75
MockitoAnnotations .initMocks (this );
71
76
72
77
mHandler = new SocialProviderResponseHandler (RuntimeEnvironment .application );
73
-
74
- List <String > allExceptGitHub = new ArrayList <>(AuthUI .SUPPORTED_PROVIDERS );
75
- allExceptGitHub .remove (GithubAuthProvider .PROVIDER_ID );
76
- FlowParameters testParams = TestHelper .getFlowParameters (allExceptGitHub );
78
+ FlowParameters testParams = TestHelper .getFlowParameters (NON_GITHUB_PROVIDERS );
77
79
78
80
mHandler .initializeForTesting (testParams , mMockAuth , null , null );
79
81
}
@@ -316,7 +318,8 @@ public void testSignInIdp_anonymousUserUpgradeEnabledAndExistingPasswordUserWith
316
318
317
319
private void setupAnonymousUpgrade () {
318
320
// enableAnonymousUpgrade must be set to true
319
- FlowParameters testParams = TestHelper .getFlowParameters (AuthUI .SUPPORTED_PROVIDERS , /* enableAnonymousUpgrade */ true );
321
+ FlowParameters testParams = TestHelper .getFlowParameters (NON_GITHUB_PROVIDERS ,
322
+ /* enableAnonymousUpgrade */ true );
320
323
mHandler .initializeForTesting (testParams , mMockAuth , null , null );
321
324
322
325
when (mUser .isAnonymous ()).thenReturn (true );
0 commit comments