LoanAccountAction extends AccountAppAction implements QuestionnaireAction { @TransactionDemarcate(joinToken = true) @Override public ActionForward captureQuestionResponses(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response) throws Exception { request.setAttribute(METHODCALLED, "captureQuestionResponses"); LoanAccountActionForm actionForm = (LoanAccountActionForm) form; setPerspective(request, actionForm.getPerspective()); ActionErrors errors = createLoanQuestionnaire.validateResponses(request, actionForm); if (errors != null && !errors.isEmpty()) { addErrors(request, errors); return mapping.findForward(ActionForwards.captureQuestionResponses.toString()); } return createLoanQuestionnaire.rejoinFlow(mapping); } LoanAccountAction();  LoanAccountAction(final ConfigurationBusinessService configService,
                             final LoanBusinessService loanBusinessService, final GlimLoanUpdater glimLoanUpdater,
                             final LoanPrdBusinessService loanPrdBusinessService,
                             final ConfigurationPersistence configurationPersistence,
                             final AccountBusinessService accountBusinessService,
                             final GroupLoanAccountServiceFacade groupLoanAccountServiceFacade,
                             final InformationOrderServiceFacade informationOrderServiceFacade); @Deprecated  LoanAccountAction(final LoanBusinessService loanBusinessService, final ConfigurationBusinessService configService,
                      final GlimLoanUpdater glimLoanUpdater); @Deprecated private  LoanAccountAction(final ConfigurationBusinessService configService,
                              final LoanBusinessService loanBusinessService, final GlimLoanUpdater glimLoanUpdater); ActionForward viewAndEditAdditionalInformation(final ActionMapping mapping, @SuppressWarnings("unused") final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward getInstallmentDetails(final ActionMapping mapping,
                                               @SuppressWarnings("unused") final ActionForm form, final HttpServletRequest request,
                                               @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward getAllActivity(final ActionMapping mapping, @SuppressWarnings("unused") final ActionForm form,
                                        final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward forwardWaiveCharge(final ActionMapping mapping,
                                            @SuppressWarnings("unused") final ActionForm form, final HttpServletRequest request,
                                            @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(saveToken = true) ActionForward get(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request,
                             @SuppressWarnings("unused") final HttpServletResponse response); void setQuestionGroupInstances(QuestionnaireServiceFacade questionnaireServiceFacade, HttpServletRequest request, Integer loanAccountId); @TransactionDemarcate(saveToken = true) ActionForward getLoanRepaymentSchedule(final ActionMapping mapping,
                                                  final ActionForm form, final HttpServletRequest request,
                                                  @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward viewOriginalSchedule(final ActionMapping mapping,
                                              @SuppressWarnings("unused") final ActionForm form, final HttpServletRequest request,
                                              @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward viewStatusHistory(final ActionMapping mapping,
                                           @SuppressWarnings("unused") final ActionForm form, final HttpServletRequest request,
                                           @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward validate(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request,
                                  @SuppressWarnings("unused") final HttpServletResponse response); ActionForward redoLoanBegin(final ActionMapping mapping, @SuppressWarnings("unused") final ActionForm form,
                                       @SuppressWarnings("unused") final HttpServletRequest request,
                                       @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward manage(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request,
                                @SuppressWarnings("unused") final HttpServletResponse response); static void setSessionAtributeForGLIM(final HttpServletRequest request, LoanBO loanBO); @TransactionDemarcate(joinToken = true) ActionForward managePrevious(final ActionMapping mapping, @SuppressWarnings("unused") final ActionForm form,
                                        final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward managePreview(final ActionMapping mapping, final ActionForm form,
                                       final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(validateAndResetToken = true) ActionForward cancel(final ActionMapping mapping, @SuppressWarnings("unused") final ActionForm form,
                                @SuppressWarnings("unused") final HttpServletRequest request,
                                @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(validateAndResetToken = true) ActionForward update(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request,
                                @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) @Override ActionForward captureQuestionResponses(final ActionMapping mapping, final ActionForm form,
                                                  final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) @Override ActionForward editQuestionResponses(
            final ActionMapping mapping, final ActionForm form,
            final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response); void setCustomerDao(CustomerDao customerDao); @TransactionDemarcate(saveToken = true) ActionForward getGroupLoanAccountDetails(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request,
                             @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward getGroupLoanRepaymentSchedule(final ActionMapping mapping,
                                                  final ActionForm form, final HttpServletRequest request,
                                                  @SuppressWarnings("unused") final HttpServletResponse response); ActionForward getDetails(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request,
            @SuppressWarnings("unused") final HttpServletResponse response); static final String CUSTOMER_ID; static final String ACCOUNT_ID; static final String GLOBAL_ACCOUNT_NUM; }
@Test public void captureQuestionResponses() throws Exception { String redoLoan = "redoLoan"; when(form.getPerspective()).thenReturn(redoLoan); ActionErrors errors = mock(ActionErrors.class); ActionForward forward = mock(ActionForward.class); when(createLoanQuestionnaire.validateResponses(request, form)).thenReturn(errors); when(errors.isEmpty()).thenReturn(true); when(createLoanQuestionnaire.rejoinFlow(mapping)).thenReturn(forward); loanAccountAction.captureQuestionResponses(mapping, form, request, response); verify(request,times(1)).setAttribute(eq(LoanConstants.METHODCALLED), eq("captureQuestionResponses")); verify(request,times(1)).setAttribute(PERSPECTIVE, redoLoan); verify(createLoanQuestionnaire).rejoinFlow(mapping); }