Search in sources :

Example 1 with QuestionnaireFlowAdapter

use of org.mifos.application.questionnaire.struts.QuestionnaireFlowAdapter in project head by mifos.

the class LoanAccountActionTest method setUp.

@Before
public void setUp() throws PageExpiredException {
    loanAccountAction = new LoanAccountAction(null, loanBusinessService, null, loanPrdBusinessService, null, null, null, null) {

        @SuppressWarnings("unused")
        @Override
        LoanBO getLoan(Integer loanId) {
            return loanBO;
        }

        @Override
        protected UserContext getUserContext(@SuppressWarnings("unused") HttpServletRequest request) {
            return userContext;
        }

        @Override
        QuestionnaireFlowAdapter getCreateLoanQuestionnaire() {
            return createLoanQuestionnaire;
        }
    };
    loanAccountAction.setLoanServiceFacade(loanServiceFacade);
    loanAccountAction.setLoanAccountServiceFacade(loanAccountServiceFacade);
    loanAccountAction.setCustomerDao(customerDao);
    when(request.getAttribute(Constants.CURRENTFLOWKEY)).thenReturn(FLOW_KEY);
    when(request.getSession()).thenReturn(session);
    when(session.getAttribute(Constants.FLOWMANAGER)).thenReturn(flowManager);
    flow = new Flow();
    when(flowManager.getFlowWithValidation(FLOW_KEY)).thenReturn(flow);
    when(userContext.getLocaleId()).thenReturn(localeId);
    when(userContext.getPreferredLocale()).thenReturn(Locale.US);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) UserContext(org.mifos.security.util.UserContext) LoanBO(org.mifos.accounts.loan.business.LoanBO) QuestionnaireFlowAdapter(org.mifos.application.questionnaire.struts.QuestionnaireFlowAdapter) Flow(org.mifos.framework.util.helpers.Flow) Before(org.junit.Before)

Aggregations

HttpServletRequest (javax.servlet.http.HttpServletRequest)1 Before (org.junit.Before)1 LoanBO (org.mifos.accounts.loan.business.LoanBO)1 QuestionnaireFlowAdapter (org.mifos.application.questionnaire.struts.QuestionnaireFlowAdapter)1 Flow (org.mifos.framework.util.helpers.Flow)1 UserContext (org.mifos.security.util.UserContext)1