@Test public void testFindUserByUserName()throws Exception{ for(int i =0; i< 100;i++) { User user = userService.findUserByUserName("admin"); assertEquals(user.getUserName(), "admin"); } }
public User findUserByUserName(String userName) { return userDao.findUserByUserName(userName); }
UserService { public User findUserByUserName(String userName) { return userDao.findUserByUserName(userName); } }
UserService { public User findUserByUserName(String userName) { return userDao.findUserByUserName(userName); }  }
UserService { public User findUserByUserName(String userName) { return userDao.findUserByUserName(userName); }  boolean hasMatchUser(String userName, String password); User findUserByUserName(String userName); @Transactional void loginSuccess(User user); @Autowired void setUserDao(UserDao userDao); @Autowired void setLoginLogDao(LoginLogDao loginLogDao); }
UserService { public User findUserByUserName(String userName) { return userDao.findUserByUserName(userName); }  boolean hasMatchUser(String userName, String password); User findUserByUserName(String userName); @Transactional void loginSuccess(User user); @Autowired void setUserDao(UserDao userDao); @Autowired void setLoginLogDao(LoginLogDao loginLogDao);  }