@Test
public void register() throws UserExistException{

	User user = new User();
	user.setUserName("testwww");
	user.setPassword("1234");
	
	doAnswer(new Answer<User>() {
		public User answer(InvocationOnMock invocation) {
			Object[] args = invocation.getArguments();
			User user = (User) args[0];
			if (user != null) {
				user.setUserId(1);
			}
			return user;
		}
	}).when(userDao).save(user);
		
	userService.register(user);
	assertEquals(user.getUserId(), 1);
	verify(userDao, times(1)).save(user);
}