@Test public void createLoginActivityIntentShouldReturnAnIntentWithExtrasInIt() { AuthenticationRequest authenticationRequest = new AuthenticationRequest .Builder("test", AuthenticationResponse.Type.TOKEN, "to: .setScopes(new String[]{"testa", "toppen"}) .build(); Activity activity = mock(Activity.class); Intent intent = AuthenticationClient.createLoginActivityIntent(activity, authenticationRequest); AuthenticationRequest extra = intent .getBundleExtra(LoginActivity.EXTRA_AUTH_REQUEST).getParcelable(LoginActivity.REQUEST_KEY); assertNotNull(extra); assertEquals("test", extra.getClientId()); assertEquals("token", extra.getResponseType()); assertEquals("to: assertEquals(2, extra.getScopes().length); }
public static Intent createLoginActivityIntent(Activity contextActivity, AuthenticationRequest request) { return LoginActivity.getAuthIntent(contextActivity, request); }
AuthenticationClient { public static Intent createLoginActivityIntent(Activity contextActivity, AuthenticationRequest request) { return LoginActivity.getAuthIntent(contextActivity, request); } }
AuthenticationClient { public static Intent createLoginActivityIntent(Activity contextActivity, AuthenticationRequest request) { return LoginActivity.getAuthIntent(contextActivity, request); } AuthenticationClient(Activity activity); }
AuthenticationClient { public static Intent createLoginActivityIntent(Activity contextActivity, AuthenticationRequest request) { return LoginActivity.getAuthIntent(contextActivity, request); } AuthenticationClient(Activity activity); static void openLoginInBrowser(Activity contextActivity, AuthenticationRequest request); static Intent createLoginActivityIntent(Activity contextActivity, AuthenticationRequest request); static void openLoginActivity(Activity contextActivity, int requestCode, AuthenticationRequest request); static void stopLoginActivity(Activity contextActivity, int requestCode); static AuthenticationResponse getResponse(int resultCode, Intent intent); static void openDownloadSpotifyActivity(Activity contextActivity); static void openDownloadSpotifyActivity(Activity contextActivity, String campaign); static boolean isAvailable(Context ctx, Intent intent); }
AuthenticationClient { public static Intent createLoginActivityIntent(Activity contextActivity, AuthenticationRequest request) { return LoginActivity.getAuthIntent(contextActivity, request); } AuthenticationClient(Activity activity); static void openLoginInBrowser(Activity contextActivity, AuthenticationRequest request); static Intent createLoginActivityIntent(Activity contextActivity, AuthenticationRequest request); static void openLoginActivity(Activity contextActivity, int requestCode, AuthenticationRequest request); static void stopLoginActivity(Activity contextActivity, int requestCode); static AuthenticationResponse getResponse(int resultCode, Intent intent); static void openDownloadSpotifyActivity(Activity contextActivity); static void openDownloadSpotifyActivity(Activity contextActivity, String campaign); static boolean isAvailable(Context ctx, Intent intent);  }