@Test public void testLogInInWithNoUserName() throws Exception { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Must specify a username for the user to log in with"); ParseTaskUtils.wait(ParseUser.logInInBackground(null, "password")); }
public static Task<ParseUser> logInInBackground(String username, String password) { if (username == null) { throw new IllegalArgumentException("Must specify a username for the user to log in with"); } if (password == null) { throw new IllegalArgumentException("Must specify a password for the user to log in with"); } return getUserController().logInAsync(username, password).onSuccessTask(new Continuation<State, Task<ParseUser>>() { @Override public Task<ParseUser> then(Task<State> task) { State result = task.getResult(); final ParseUser newCurrent = ParseObject.from(result); return saveCurrentUserAsync(newCurrent).onSuccess(new Continuation<Void, ParseUser>() { @Override public ParseUser then(Task<Void> task) { return newCurrent; } }); } }); }
ParseUser extends ParseObject { public static Task<ParseUser> logInInBackground(String username, String password) { if (username == null) { throw new IllegalArgumentException("Must specify a username for the user to log in with"); } if (password == null) { throw new IllegalArgumentException("Must specify a password for the user to log in with"); } return getUserController().logInAsync(username, password).onSuccessTask(new Continuation<State, Task<ParseUser>>() { @Override public Task<ParseUser> then(Task<State> task) { State result = task.getResult(); final ParseUser newCurrent = ParseObject.from(result); return saveCurrentUserAsync(newCurrent).onSuccess(new Continuation<Void, ParseUser>() { @Override public ParseUser then(Task<Void> task) { return newCurrent; } }); } }); } }
ParseUser extends ParseObject { public static Task<ParseUser> logInInBackground(String username, String password) { if (username == null) { throw new IllegalArgumentException("Must specify a username for the user to log in with"); } if (password == null) { throw new IllegalArgumentException("Must specify a password for the user to log in with"); } return getUserController().logInAsync(username, password).onSuccessTask(new Continuation<State, Task<ParseUser>>() { @Override public Task<ParseUser> then(Task<State> task) { State result = task.getResult(); final ParseUser newCurrent = ParseObject.from(result); return saveCurrentUserAsync(newCurrent).onSuccess(new Continuation<Void, ParseUser>() { @Override public ParseUser then(Task<Void> task) { return newCurrent; } }); } }); } ParseUser(); }
ParseUser extends ParseObject { public static Task<ParseUser> logInInBackground(String username, String password) { if (username == null) { throw new IllegalArgumentException("Must specify a username for the user to log in with"); } if (password == null) { throw new IllegalArgumentException("Must specify a password for the user to log in with"); } return getUserController().logInAsync(username, password).onSuccessTask(new Continuation<State, Task<ParseUser>>() { @Override public Task<ParseUser> then(Task<State> task) { State result = task.getResult(); final ParseUser newCurrent = ParseObject.from(result); return saveCurrentUserAsync(newCurrent).onSuccess(new Continuation<Void, ParseUser>() { @Override public ParseUser then(Task<Void> task) { return newCurrent; } }); } }); } ParseUser(); static ParseQuery<ParseUser> getQuery(); static Task<ParseUser> logInInBackground(String username, String password); static ParseUser logIn(String username, String password); static void logInInBackground(final String username, final String password,
                                         LogInCallback callback); static Task<ParseUser> becomeInBackground(String sessionToken); static ParseUser become(String sessionToken); static void becomeInBackground(final String sessionToken, LogInCallback callback); static ParseUser getCurrentUser(); static String getCurrentSessionToken(); static Task<String> getCurrentSessionTokenAsync(); static Task<Void> logOutInBackground(); static void logOutInBackground(LogOutCallback callback); static void logOut(); static Task<Void> requestPasswordResetInBackground(String email); static void requestPasswordReset(String email); static void requestPasswordResetInBackground(final String email,
                                                        RequestPasswordResetCallback callback); static void registerAuthenticationCallback(
            String authType, AuthenticationCallback callback); static Task<ParseUser> logInWithInBackground(
            final String authType, final Map<String, String> authData); static void enableAutomaticUser(); static Task<Void> enableRevocableSessionInBackground(); boolean isAuthenticated(); @Override void remove(@NonNull String key); String getSessionToken(); String getUsername(); void setUsername(String username); void setPassword(String password); String getEmail(); void setEmail(String email); boolean isNew(); @Override void put(@NonNull String key, @NonNull Object value); @SuppressWarnings("unchecked") @Override ParseUser fetch(); Task<Void> signUpInBackground(); void signUp(); void signUpInBackground(SignUpCallback callback); @SuppressWarnings("unchecked") @Override ParseUser fetchIfNeeded(); boolean isLinked(String authType); Task<Void> linkWithInBackground(
            String authType, Map<String, String> authData); Task<Void> unlinkFromInBackground(final String authType); }
ParseUser extends ParseObject { public static Task<ParseUser> logInInBackground(String username, String password) { if (username == null) { throw new IllegalArgumentException("Must specify a username for the user to log in with"); } if (password == null) { throw new IllegalArgumentException("Must specify a password for the user to log in with"); } return getUserController().logInAsync(username, password).onSuccessTask(new Continuation<State, Task<ParseUser>>() { @Override public Task<ParseUser> then(Task<State> task) { State result = task.getResult(); final ParseUser newCurrent = ParseObject.from(result); return saveCurrentUserAsync(newCurrent).onSuccess(new Continuation<Void, ParseUser>() { @Override public ParseUser then(Task<Void> task) { return newCurrent; } }); } }); } ParseUser(); static ParseQuery<ParseUser> getQuery(); static Task<ParseUser> logInInBackground(String username, String password); static ParseUser logIn(String username, String password); static void logInInBackground(final String username, final String password,
                                         LogInCallback callback); static Task<ParseUser> becomeInBackground(String sessionToken); static ParseUser become(String sessionToken); static void becomeInBackground(final String sessionToken, LogInCallback callback); static ParseUser getCurrentUser(); static String getCurrentSessionToken(); static Task<String> getCurrentSessionTokenAsync(); static Task<Void> logOutInBackground(); static void logOutInBackground(LogOutCallback callback); static void logOut(); static Task<Void> requestPasswordResetInBackground(String email); static void requestPasswordReset(String email); static void requestPasswordResetInBackground(final String email,
                                                        RequestPasswordResetCallback callback); static void registerAuthenticationCallback(
            String authType, AuthenticationCallback callback); static Task<ParseUser> logInWithInBackground(
            final String authType, final Map<String, String> authData); static void enableAutomaticUser(); static Task<Void> enableRevocableSessionInBackground(); boolean isAuthenticated(); @Override void remove(@NonNull String key); String getSessionToken(); String getUsername(); void setUsername(String username); void setPassword(String password); String getEmail(); void setEmail(String email); boolean isNew(); @Override void put(@NonNull String key, @NonNull Object value); @SuppressWarnings("unchecked") @Override ParseUser fetch(); Task<Void> signUpInBackground(); void signUp(); void signUpInBackground(SignUpCallback callback); @SuppressWarnings("unchecked") @Override ParseUser fetchIfNeeded(); boolean isLinked(String authType); Task<Void> linkWithInBackground(
            String authType, Map<String, String> authData); Task<Void> unlinkFromInBackground(final String authType);  }