use of org.mifos.accounts.savings.struts.actionforms.SavingsActionForm in project head by mifos.
the class SavingsAction method reLoad.
@TransactionDemarcate(joinToken = true)
public ActionForward reLoad(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
SavingsActionForm savingsActionForm = ((SavingsActionForm) form);
logger.debug(" selectedPrdOfferingId: " + (savingsActionForm).getSelectedPrdOfferingId());
Integer productId = Integer.valueOf(savingsActionForm.getSelectedPrdOfferingId());
SavingsOfferingBO savingsOfferingBO = this.savingsProductDao.findById(productId);
SessionUtils.setAttribute(SavingsConstants.PRDOFFERING, savingsOfferingBO, request);
savingsActionForm.setRecommendedAmount(savingsOfferingBO.getRecommendedAmount().toString());
logger.info("Data loaded successfully ");
return mapping.findForward("load_success");
}
use of org.mifos.accounts.savings.struts.actionforms.SavingsActionForm in project head by mifos.
the class SavingsActionStrutsTest method testSuccessfulEdit.
@Test
public void testSuccessfulEdit() throws Exception {
setMifosUserFromContext();
createAndAddObjects(AccountState.SAVINGS_PARTIAL_APPLICATION);
savingsOffering = null;
setRequestPathInfo("/savingsAction.do");
addRequestParameter("method", "get");
addRequestParameter("globalAccountNum", savings.getGlobalAccountNum());
actionPerform();
setRequestPathInfo("/savingsAction.do");
addRequestParameter("method", "edit");
addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
performNoErrors();
verifyForward("edit_success");
SavingsActionForm actionForm = (SavingsActionForm) request.getSession().getAttribute("savingsActionForm");
Assert.assertEquals("300.0", actionForm.getRecommendedAmount());
}
Aggregations