2223242526272829
@Resource(name="userServiceImpl") private UserService userService; @Test public void findUserById(){ User user = userService.findUserById(1); System.out.println(user); }
293031323334353637383940414243
} @Test public void save(){ User user=new User(); user.setUsername("��xx"); Dept dept=new Dept(); dept.setDeptname("�Ļ���"); user.setDept(dept); User u = userService.save(user); Assert.notNull(u); }
424344454647484950
} @Test public void modifyById(){ User user = userService.findUserById(1); user.setUsername("��"); userService.modifyById("��",1); }
50515253545556575859606162
} @Test public void modifyUser(){ User user = userService.findUserById(1); user.setUsername("��"); Dept dept=user.getDept(); dept.setDeptname("���"); user.setDept(dept); userService.modifyUser(user); }