@Test public final void testProcessFormSubmission() { MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); BindException aError = new BindException(new CreateUserCommand(), CreateUserCommand.ACTION_EDIT); testSetAgencyUserManager(); testSetAuthorityManager(); testSetMessageSource(); testSetEncoder(); testSetSalt(); try { ChangePasswordCommand aCommand = new ChangePasswordCommand(); aCommand.setAction(ChangePasswordCommand.ACTION_SAVE); aCommand.setUserOid(1000L); aCommand.setNewPwd("Pa55word"); aCommand.setConfirmPwd("Pa55word"); ModelAndView mav = testInstance.processFormSubmission(request, response, aCommand, aError); assertTrue(mav != null); assertTrue(mav.getViewName().equals("viewUsers")); List<Agency> agencies = (List<Agency>)mav.getModel().get("agencies"); assertTrue(agencies != null); assertTrue(agencies.size() > 0); } catch (Exception e) { String message = e.getClass().toString() + " - " + e.getMessage(); log.debug(message); fail(message); } }
@Override protected ModelAndView processFormSubmission(HttpServletRequest aReq, HttpServletResponse aRes, Object aCmd, BindException aBindEx) throws Exception { ChangePasswordCommand pwdCmd = (ChangePasswordCommand) aCmd; if (ChangePasswordCommand.ACTION_SAVE.equals(pwdCmd.getAction())) { ChangePasswordCommand aPwdCommand = (ChangePasswordCommand) aCmd; return processPasswordChange(aReq, aRes, aPwdCommand, aBindEx); } else { return createDefaultModelAndView(aReq, pwdCmd); } }
ChangePasswordController extends AbstractFormController { @Override protected ModelAndView processFormSubmission(HttpServletRequest aReq, HttpServletResponse aRes, Object aCmd, BindException aBindEx) throws Exception { ChangePasswordCommand pwdCmd = (ChangePasswordCommand) aCmd; if (ChangePasswordCommand.ACTION_SAVE.equals(pwdCmd.getAction())) { ChangePasswordCommand aPwdCommand = (ChangePasswordCommand) aCmd; return processPasswordChange(aReq, aRes, aPwdCommand, aBindEx); } else { return createDefaultModelAndView(aReq, pwdCmd); } } }
ChangePasswordController extends AbstractFormController { @Override protected ModelAndView processFormSubmission(HttpServletRequest aReq, HttpServletResponse aRes, Object aCmd, BindException aBindEx) throws Exception { ChangePasswordCommand pwdCmd = (ChangePasswordCommand) aCmd; if (ChangePasswordCommand.ACTION_SAVE.equals(pwdCmd.getAction())) { ChangePasswordCommand aPwdCommand = (ChangePasswordCommand) aCmd; return processPasswordChange(aReq, aRes, aPwdCommand, aBindEx); } else { return createDefaultModelAndView(aReq, pwdCmd); } } ChangePasswordController(); }
ChangePasswordController extends AbstractFormController { @Override protected ModelAndView processFormSubmission(HttpServletRequest aReq, HttpServletResponse aRes, Object aCmd, BindException aBindEx) throws Exception { ChangePasswordCommand pwdCmd = (ChangePasswordCommand) aCmd; if (ChangePasswordCommand.ACTION_SAVE.equals(pwdCmd.getAction())) { ChangePasswordCommand aPwdCommand = (ChangePasswordCommand) aCmd; return processPasswordChange(aReq, aRes, aPwdCommand, aBindEx); } else { return createDefaultModelAndView(aReq, pwdCmd); } } ChangePasswordController(); @Override void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); void setEncoder(PasswordEncoder encoder); void setSalt(SystemWideSaltSource salt); void setAgencyUserManager(AgencyUserManager agencyUserManager); void setMessageSource(MessageSource messageSource); void setAuthorityManager(AuthorityManager authorityManager); }
ChangePasswordController extends AbstractFormController { @Override protected ModelAndView processFormSubmission(HttpServletRequest aReq, HttpServletResponse aRes, Object aCmd, BindException aBindEx) throws Exception { ChangePasswordCommand pwdCmd = (ChangePasswordCommand) aCmd; if (ChangePasswordCommand.ACTION_SAVE.equals(pwdCmd.getAction())) { ChangePasswordCommand aPwdCommand = (ChangePasswordCommand) aCmd; return processPasswordChange(aReq, aRes, aPwdCommand, aBindEx); } else { return createDefaultModelAndView(aReq, pwdCmd); } } ChangePasswordController(); @Override void initBinder(HttpServletRequest request, ServletRequestDataBinder binder); void setEncoder(PasswordEncoder encoder); void setSalt(SystemWideSaltSource salt); void setAgencyUserManager(AgencyUserManager agencyUserManager); void setMessageSource(MessageSource messageSource); void setAuthorityManager(AuthorityManager authorityManager);  }