@Test public void testGetUser() throws Exception { final User testData = new User("1"); testData.getRoles().add(new Role("user")); context.checking(new Expectations() {{ one(userDao).get(with(equal(1))); will(returnValue(testData)); }}); User user = userManager.getUser("1"); assertTrue(user != null); assert user != null; assertTrue(user.getRoles().size() == 1); }
public User getUser(String userId) { return dao.get(new Integer(userId)); }
UserManagerImpl extends UniversalManagerImpl implements UserManager, UserService { public User getUser(String userId) { return dao.get(new Integer(userId)); } }
UserManagerImpl extends UniversalManagerImpl implements UserManager, UserService { public User getUser(String userId) { return dao.get(new Integer(userId)); }  }
UserManagerImpl extends UniversalManagerImpl implements UserManager, UserService { public User getUser(String userId) { return dao.get(new Integer(userId)); }  @Required void setPasswordEncoder(PasswordEncoder passwordEncoder); User getUser(String userId); List<User> getUsers(User user); String createSession(User user); User authenticate(String username, String password); User authenticate(String sessionKey); void logout(UserSession userSession); User saveUser(User user); void removeUser(String userId); User getUserByUsername(String username); UserSessionDao getUserSessionDao(); void setUserSessionDao(UserSessionDao userSessionDao); @Required void setUserDao(UserDao dao); }
UserManagerImpl extends UniversalManagerImpl implements UserManager, UserService { public User getUser(String userId) { return dao.get(new Integer(userId)); }  @Required void setPasswordEncoder(PasswordEncoder passwordEncoder); User getUser(String userId); List<User> getUsers(User user); String createSession(User user); User authenticate(String username, String password); User authenticate(String sessionKey); void logout(UserSession userSession); User saveUser(User user); void removeUser(String userId); User getUserByUsername(String username); UserSessionDao getUserSessionDao(); void setUserSessionDao(UserSessionDao userSessionDao); @Required void setUserDao(UserDao dao);  }