@Test public void testRegisterAnonymous() { manager.register("anonymous", mock(AuthenticationCallback.class)); verifyNoMoreInteractions(controller); }
public void register(final String authType, AuthenticationCallback callback) { if (authType == null) { throw new IllegalArgumentException("Invalid authType: " + null); } synchronized (lock) { if (this.callbacks.containsKey(authType)) { throw new IllegalStateException("Callback already registered for <" + authType + ">: " + this.callbacks.get(authType)); } this.callbacks.put(authType, callback); } if (ParseAnonymousUtils.AUTH_TYPE.equals(authType)) { return; } controller.getAsync(false).onSuccessTask(new Continuation<ParseUser, Task<Void>>() { @Override public Task<Void> then(Task<ParseUser> task) { ParseUser user = task.getResult(); if (user != null) { return user.synchronizeAuthDataAsync(authType); } return null; } }); }
ParseAuthenticationManager { public void register(final String authType, AuthenticationCallback callback) { if (authType == null) { throw new IllegalArgumentException("Invalid authType: " + null); } synchronized (lock) { if (this.callbacks.containsKey(authType)) { throw new IllegalStateException("Callback already registered for <" + authType + ">: " + this.callbacks.get(authType)); } this.callbacks.put(authType, callback); } if (ParseAnonymousUtils.AUTH_TYPE.equals(authType)) { return; } controller.getAsync(false).onSuccessTask(new Continuation<ParseUser, Task<Void>>() { @Override public Task<Void> then(Task<ParseUser> task) { ParseUser user = task.getResult(); if (user != null) { return user.synchronizeAuthDataAsync(authType); } return null; } }); } }
ParseAuthenticationManager { public void register(final String authType, AuthenticationCallback callback) { if (authType == null) { throw new IllegalArgumentException("Invalid authType: " + null); } synchronized (lock) { if (this.callbacks.containsKey(authType)) { throw new IllegalStateException("Callback already registered for <" + authType + ">: " + this.callbacks.get(authType)); } this.callbacks.put(authType, callback); } if (ParseAnonymousUtils.AUTH_TYPE.equals(authType)) { return; } controller.getAsync(false).onSuccessTask(new Continuation<ParseUser, Task<Void>>() { @Override public Task<Void> then(Task<ParseUser> task) { ParseUser user = task.getResult(); if (user != null) { return user.synchronizeAuthDataAsync(authType); } return null; } }); } ParseAuthenticationManager(ParseCurrentUserController controller); }
ParseAuthenticationManager { public void register(final String authType, AuthenticationCallback callback) { if (authType == null) { throw new IllegalArgumentException("Invalid authType: " + null); } synchronized (lock) { if (this.callbacks.containsKey(authType)) { throw new IllegalStateException("Callback already registered for <" + authType + ">: " + this.callbacks.get(authType)); } this.callbacks.put(authType, callback); } if (ParseAnonymousUtils.AUTH_TYPE.equals(authType)) { return; } controller.getAsync(false).onSuccessTask(new Continuation<ParseUser, Task<Void>>() { @Override public Task<Void> then(Task<ParseUser> task) { ParseUser user = task.getResult(); if (user != null) { return user.synchronizeAuthDataAsync(authType); } return null; } }); } ParseAuthenticationManager(ParseCurrentUserController controller); void register(final String authType, AuthenticationCallback callback); Task<Boolean> restoreAuthenticationAsync(String authType, final Map<String, String> authData); Task<Void> deauthenticateAsync(String authType); }
ParseAuthenticationManager { public void register(final String authType, AuthenticationCallback callback) { if (authType == null) { throw new IllegalArgumentException("Invalid authType: " + null); } synchronized (lock) { if (this.callbacks.containsKey(authType)) { throw new IllegalStateException("Callback already registered for <" + authType + ">: " + this.callbacks.get(authType)); } this.callbacks.put(authType, callback); } if (ParseAnonymousUtils.AUTH_TYPE.equals(authType)) { return; } controller.getAsync(false).onSuccessTask(new Continuation<ParseUser, Task<Void>>() { @Override public Task<Void> then(Task<ParseUser> task) { ParseUser user = task.getResult(); if (user != null) { return user.synchronizeAuthDataAsync(authType); } return null; } }); } ParseAuthenticationManager(ParseCurrentUserController controller); void register(final String authType, AuthenticationCallback callback); Task<Boolean> restoreAuthenticationAsync(String authType, final Map<String, String> authData); Task<Void> deauthenticateAsync(String authType);  }