@Test public void testLoadUserAsync_dispatch() throws InterruptedException { RestInvocations.loadProjectUsers(handler); handler.async(); projectUserService.loadUserAsync("tester", new DispatchTestCallback<User>(handler) { @Override public void evaluate(User user) { Assert.assertEquals("tester", user.getUsername()); Assert.assertEquals("Integration Test", user.getFullName()); } }); }
public void loadUserAsync(final String username, final Callback<User> callback) { loadUsersAsync(translate(callback, new Transform<UserList, User>() { @Override public User transform(UserList users) { User user = users.getUser(username); if(user == null) { return new User(username, username); } else { return user; } } })); }
ProjectUserService extends AbstractCachingService<Integer, UserList, AbstractCachingService.Callback<UserList>> { public void loadUserAsync(final String username, final Callback<User> callback) { loadUsersAsync(translate(callback, new Transform<UserList, User>() { @Override public User transform(UserList users) { User user = users.getUser(username); if(user == null) { return new User(username, username); } else { return user; } } })); } }
ProjectUserService extends AbstractCachingService<Integer, UserList, AbstractCachingService.Callback<UserList>> { public void loadUserAsync(final String username, final Callback<User> callback) { loadUsersAsync(translate(callback, new Transform<UserList, User>() { @Override public User transform(UserList users) { User user = users.getUser(username); if(user == null) { return new User(username, username); } else { return user; } } })); } ProjectUserService(Project project); }
ProjectUserService extends AbstractCachingService<Integer, UserList, AbstractCachingService.Callback<UserList>> { public void loadUserAsync(final String username, final Callback<User> callback) { loadUsersAsync(translate(callback, new Transform<UserList, User>() { @Override public User transform(UserList users) { User user = users.getUser(username); if(user == null) { return new User(username, username); } else { return user; } } })); } ProjectUserService(Project project); void loadUsersAsync(Callback<UserList> callback); User tryGetUser(String username); void loadUserAsync(final String username, final Callback<User> callback); UserList getUserList(); User getUser(String username); String getUserFullName(String username); }
ProjectUserService extends AbstractCachingService<Integer, UserList, AbstractCachingService.Callback<UserList>> { public void loadUserAsync(final String username, final Callback<User> callback) { loadUsersAsync(translate(callback, new Transform<UserList, User>() { @Override public User transform(UserList users) { User user = users.getUser(username); if(user == null) { return new User(username, username); } else { return user; } } })); } ProjectUserService(Project project); void loadUsersAsync(Callback<UserList> callback); User tryGetUser(String username); void loadUserAsync(final String username, final Callback<User> callback); UserList getUserList(); User getUser(String username); String getUserFullName(String username);  }