@Test public void testTryGetUser() { User tester = projectUserService.tryGetUser("tester"); Assert.assertNull(tester); RestInvocations.loadProjectUsers(handler); projectUserService.getUser("tester"); tester = projectUserService.tryGetUser("tester"); Assert.assertEquals("tester", tester.getUsername()); Assert.assertEquals("Integration Test", tester.getFullName()); }
public User tryGetUser(String username) { UserList users = getCachedValue(1); if(users != null) { User user = users.getUser(username); if(user == null) { return new User(username, username); } return user; } else { return null; } }
ProjectUserService extends AbstractCachingService<Integer, UserList, AbstractCachingService.Callback<UserList>> { public User tryGetUser(String username) { UserList users = getCachedValue(1); if(users != null) { User user = users.getUser(username); if(user == null) { return new User(username, username); } return user; } else { return null; } } }
ProjectUserService extends AbstractCachingService<Integer, UserList, AbstractCachingService.Callback<UserList>> { public User tryGetUser(String username) { UserList users = getCachedValue(1); if(users != null) { User user = users.getUser(username); if(user == null) { return new User(username, username); } return user; } else { return null; } } ProjectUserService(Project project); }
ProjectUserService extends AbstractCachingService<Integer, UserList, AbstractCachingService.Callback<UserList>> { public User tryGetUser(String username) { UserList users = getCachedValue(1); if(users != null) { User user = users.getUser(username); if(user == null) { return new User(username, username); } return user; } else { return null; } } 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 User tryGetUser(String username) { UserList users = getCachedValue(1); if(users != null) { User user = users.getUser(username); if(user == null) { return new User(username, username); } return user; } else { return null; } } 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);  }