我想为struts 2动作类方法编写junit测试。如何为addUser函数编写测试用例?我的动作课看起来像这样
puble class UserAction{
public String addUser(){
User user = new User();
user.setUserName("user");
user.setPassword("password");
UserDAO userDAO = new UserDAO()
userDAO.addUser(user)
return SUCCESS;
}