@Test public void testLoginAsyncWithUserNameAndPassword() throws Exception { JSONObject mockResponse = generateBasicMockResponse(); ParseHttpClient restClient = ParseTestUtils.mockParseHttpClientWithResponse(mockResponse, 200, "OK"); NetworkUserController controller = new NetworkUserController(restClient); ParseUser.State newState = ParseTaskUtils.wait(controller.logInAsync("userName", "password")); verifyBasicUserState(mockResponse, newState); assertTrue(newState.isComplete()); assertFalse(newState.isNew()); }
@Override public Task<ParseUser.State> logInAsync( String username, String password) { ParseRESTCommand command = ParseRESTUserCommand.logInUserCommand( username, password, revocableSession); return command.executeAsync(client).onSuccess(new Continuation<JSONObject, ParseUser.State>() { @Override public ParseUser.State then(Task<JSONObject> task) { JSONObject result = task.getResult(); return coder.decode(new ParseUser.State.Builder(), result, ParseDecoder.get()) .isComplete(true) .build(); } }); }
NetworkUserController implements ParseUserController { @Override public Task<ParseUser.State> logInAsync( String username, String password) { ParseRESTCommand command = ParseRESTUserCommand.logInUserCommand( username, password, revocableSession); return command.executeAsync(client).onSuccess(new Continuation<JSONObject, ParseUser.State>() { @Override public ParseUser.State then(Task<JSONObject> task) { JSONObject result = task.getResult(); return coder.decode(new ParseUser.State.Builder(), result, ParseDecoder.get()) .isComplete(true) .build(); } }); } }
NetworkUserController implements ParseUserController { @Override public Task<ParseUser.State> logInAsync( String username, String password) { ParseRESTCommand command = ParseRESTUserCommand.logInUserCommand( username, password, revocableSession); return command.executeAsync(client).onSuccess(new Continuation<JSONObject, ParseUser.State>() { @Override public ParseUser.State then(Task<JSONObject> task) { JSONObject result = task.getResult(); return coder.decode(new ParseUser.State.Builder(), result, ParseDecoder.get()) .isComplete(true) .build(); } }); } NetworkUserController(ParseHttpClient client);  NetworkUserController(ParseHttpClient client, boolean revocableSession); }
NetworkUserController implements ParseUserController { @Override public Task<ParseUser.State> logInAsync( String username, String password) { ParseRESTCommand command = ParseRESTUserCommand.logInUserCommand( username, password, revocableSession); return command.executeAsync(client).onSuccess(new Continuation<JSONObject, ParseUser.State>() { @Override public ParseUser.State then(Task<JSONObject> task) { JSONObject result = task.getResult(); return coder.decode(new ParseUser.State.Builder(), result, ParseDecoder.get()) .isComplete(true) .build(); } }); } NetworkUserController(ParseHttpClient client);  NetworkUserController(ParseHttpClient client, boolean revocableSession); @Override Task<ParseUser.State> signUpAsync(
            final ParseObject.State state,
            ParseOperationSet operations,
            String sessionToken); @Override Task<ParseUser.State> logInAsync(
            String username, String password); @Override Task<ParseUser.State> logInAsync(
            ParseUser.State state, ParseOperationSet operations); @Override Task<ParseUser.State> logInAsync(
            final String authType, final Map<String, String> authData); @Override Task<ParseUser.State> getUserAsync(String sessionToken); @Override Task<Void> requestPasswordResetAsync(String email); }
NetworkUserController implements ParseUserController { @Override public Task<ParseUser.State> logInAsync( String username, String password) { ParseRESTCommand command = ParseRESTUserCommand.logInUserCommand( username, password, revocableSession); return command.executeAsync(client).onSuccess(new Continuation<JSONObject, ParseUser.State>() { @Override public ParseUser.State then(Task<JSONObject> task) { JSONObject result = task.getResult(); return coder.decode(new ParseUser.State.Builder(), result, ParseDecoder.get()) .isComplete(true) .build(); } }); } NetworkUserController(ParseHttpClient client);  NetworkUserController(ParseHttpClient client, boolean revocableSession); @Override Task<ParseUser.State> signUpAsync(
            final ParseObject.State state,
            ParseOperationSet operations,
            String sessionToken); @Override Task<ParseUser.State> logInAsync(
            String username, String password); @Override Task<ParseUser.State> logInAsync(
            ParseUser.State state, ParseOperationSet operations); @Override Task<ParseUser.State> logInAsync(
            final String authType, final Map<String, String> authData); @Override Task<ParseUser.State> getUserAsync(String sessionToken); @Override Task<Void> requestPasswordResetAsync(String email);  }