@Test @SuppressWarnings("unchecked") public void testLogInWithToken() { ParseTwitterUtils.isInitialized = true; ParseUser user = mock(ParseUser.class); when(userDelegate.logInWithInBackground(anyString(), anyMapOf(String.class, String.class))) .thenReturn(Task.forResult(user)); String twitterId = "test_id"; String screenName = "test_screen_name"; String authToken = "test_token"; String authSecret = "test_secret"; Task<ParseUser> task = ParseTwitterUtils.logInInBackground( twitterId, screenName, authToken, authSecret); verify(controller).getAuthData(twitterId, screenName, authToken, authSecret); verify(userDelegate).logInWithInBackground(eq("twitter"), anyMapOf(String.class, String.class)); assertTrue(task.isCompleted()); }
public static Task<ParseUser> logInInBackground(String twitterId, String screenName, String authToken, String authTokenSecret) { checkInitialization(); Map<String, String> authData = getTwitterController().getAuthData( twitterId, screenName, authToken, authTokenSecret); return userDelegate.logInWithInBackground(AUTH_TYPE, authData); }
ParseTwitterUtils { public static Task<ParseUser> logInInBackground(String twitterId, String screenName, String authToken, String authTokenSecret) { checkInitialization(); Map<String, String> authData = getTwitterController().getAuthData( twitterId, screenName, authToken, authTokenSecret); return userDelegate.logInWithInBackground(AUTH_TYPE, authData); } }
ParseTwitterUtils { public static Task<ParseUser> logInInBackground(String twitterId, String screenName, String authToken, String authTokenSecret) { checkInitialization(); Map<String, String> authData = getTwitterController().getAuthData( twitterId, screenName, authToken, authTokenSecret); return userDelegate.logInWithInBackground(AUTH_TYPE, authData); } private  ParseTwitterUtils(); }
ParseTwitterUtils { public static Task<ParseUser> logInInBackground(String twitterId, String screenName, String authToken, String authTokenSecret) { checkInitialization(); Map<String, String> authData = getTwitterController().getAuthData( twitterId, screenName, authToken, authTokenSecret); return userDelegate.logInWithInBackground(AUTH_TYPE, authData); } private  ParseTwitterUtils(); static Twitter getTwitter(); static void initialize(String consumerKey, String consumerSecret); static void initialize(String consumerKey, String consumerSecret, String callbackUrl); static boolean isLinked(ParseUser user); static Task<Void> linkInBackground(Context context, final ParseUser user); @Deprecated static void link(ParseUser user, Context context); static void link(ParseUser user, Context context, SaveCallback callback); static Task<Void> linkInBackground(ParseUser user, String twitterId, String screenName,
                                              String authToken, String authTokenSecret); @Deprecated static void link(ParseUser user, String twitterId, String screenName, String authToken,
                            String authTokenSecret); static void link(ParseUser user, String twitterId, String screenName, String authToken,
                            String authTokenSecret, SaveCallback callback); static Task<ParseUser> logInInBackground(String twitterId, String screenName,
                                                    String authToken, String authTokenSecret); static void logIn(String twitterId, String screenName, String authToken,
                             String authTokenSecret, LogInCallback callback); static Task<ParseUser> logInInBackground(Context context); static void logIn(Context context, LogInCallback callback); static void unlink(ParseUser user); static Task<Void> unlinkInBackground(ParseUser user); static void unlinkInBackground(ParseUser user, SaveCallback callback); }
ParseTwitterUtils { public static Task<ParseUser> logInInBackground(String twitterId, String screenName, String authToken, String authTokenSecret) { checkInitialization(); Map<String, String> authData = getTwitterController().getAuthData( twitterId, screenName, authToken, authTokenSecret); return userDelegate.logInWithInBackground(AUTH_TYPE, authData); } private  ParseTwitterUtils(); static Twitter getTwitter(); static void initialize(String consumerKey, String consumerSecret); static void initialize(String consumerKey, String consumerSecret, String callbackUrl); static boolean isLinked(ParseUser user); static Task<Void> linkInBackground(Context context, final ParseUser user); @Deprecated static void link(ParseUser user, Context context); static void link(ParseUser user, Context context, SaveCallback callback); static Task<Void> linkInBackground(ParseUser user, String twitterId, String screenName,
                                              String authToken, String authTokenSecret); @Deprecated static void link(ParseUser user, String twitterId, String screenName, String authToken,
                            String authTokenSecret); static void link(ParseUser user, String twitterId, String screenName, String authToken,
                            String authTokenSecret, SaveCallback callback); static Task<ParseUser> logInInBackground(String twitterId, String screenName,
                                                    String authToken, String authTokenSecret); static void logIn(String twitterId, String screenName, String authToken,
                             String authTokenSecret, LogInCallback callback); static Task<ParseUser> logInInBackground(Context context); static void logIn(Context context, LogInCallback callback); static void unlink(ParseUser user); static Task<Void> unlinkInBackground(ParseUser user); static void unlinkInBackground(ParseUser user, SaveCallback callback);  }