@Test public void testGetAsyncLazyAnonymousUser() throws Exception { ParseUser.State state = new ParseUser.State.Builder() .putAuthData(ParseAnonymousUtils.AUTH_TYPE, new HashMap<String, String>()) .build(); ParseObjectStore<ParseUser> store = (ParseObjectStore<ParseUser>) mock(ParseObjectStore.class); when(store.getAsync()).thenReturn(Task.forResult(ParseObject.<ParseUser>from(state))); CachedCurrentUserController controller = new CachedCurrentUserController(store); ParseUser user = ParseTaskUtils.wait(controller.getAsync(false)); assertTrue(user.isLazy()); }
@Override public Task<ParseUser> getAsync() { return getAsync(ParseUser.isAutomaticUserEnabled()); }
CachedCurrentUserController implements ParseCurrentUserController { @Override public Task<ParseUser> getAsync() { return getAsync(ParseUser.isAutomaticUserEnabled()); } }
CachedCurrentUserController implements ParseCurrentUserController { @Override public Task<ParseUser> getAsync() { return getAsync(ParseUser.isAutomaticUserEnabled()); } CachedCurrentUserController(ParseObjectStore<ParseUser> store); }
CachedCurrentUserController implements ParseCurrentUserController { @Override public Task<ParseUser> getAsync() { return getAsync(ParseUser.isAutomaticUserEnabled()); } CachedCurrentUserController(ParseObjectStore<ParseUser> store); @Override Task<Void> setAsync(final ParseUser user); @Override Task<Void> setIfNeededAsync(ParseUser user); @Override Task<ParseUser> getAsync(); @Override Task<Boolean> existsAsync(); @Override boolean isCurrent(ParseUser user); @Override void clearFromMemory(); @Override void clearFromDisk(); @Override Task<String> getCurrentSessionTokenAsync(); @Override Task<Void> logOutAsync(); @Override Task<ParseUser> getAsync(final boolean shouldAutoCreateUser); }
CachedCurrentUserController implements ParseCurrentUserController { @Override public Task<ParseUser> getAsync() { return getAsync(ParseUser.isAutomaticUserEnabled()); } CachedCurrentUserController(ParseObjectStore<ParseUser> store); @Override Task<Void> setAsync(final ParseUser user); @Override Task<Void> setIfNeededAsync(ParseUser user); @Override Task<ParseUser> getAsync(); @Override Task<Boolean> existsAsync(); @Override boolean isCurrent(ParseUser user); @Override void clearFromMemory(); @Override void clearFromDisk(); @Override Task<String> getCurrentSessionTokenAsync(); @Override Task<Void> logOutAsync(); @Override Task<ParseUser> getAsync(final boolean shouldAutoCreateUser);  }