UserAction extends BaseAction { public String edit() { if (id != null) { user = userManager.getUser(id); } else { user = new User(); } return SUCCESS; }  void setUserManager(UserManager userManager); List<User> getUsers(); void setId(String id); User getUser(); void setUser(User user); String delete(); String edit(); String execute(); String save(); String list();  }
@Test public void testEdit() throws Exception { action.setId("-1"); assertEquals("success", action.edit()); assertNotNull(action.getUser().getFirstName()); }