GroupCustAction extends CustAction { private void setQuestionGroupInstances(HttpServletRequest request, GroupBO groupBO) throws PageExpiredException { QuestionnaireServiceFacade questionnaireServiceFacade = questionnaireServiceFacadeLocator.getService(request); if (questionnaireServiceFacade != null) { setQuestionGroupInstances(questionnaireServiceFacade, request, groupBO.getCustomerId()); } }  @TransactionDemarcate(saveToken = true) ActionForward hierarchyCheck(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(saveToken = true) ActionForward chooseOffice(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(saveToken = true) ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward loadMeeting(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, @SuppressWarnings("unused") HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                 @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward previewOnly(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request,
                                 @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward previous(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, @SuppressWarnings("unused") HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(validateAndResetToken = true) ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(saveToken = true) ActionForward get(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); void setQuestionGroupInstances(QuestionnaireServiceFacade questionnaireServiceFacade, HttpServletRequest request, Integer customerId); @TransactionDemarcate(joinToken = true) ActionForward manage(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward previewManage(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, @SuppressWarnings("unused") HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward previousManage(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, @SuppressWarnings("unused") HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(validateAndResetToken = true) @CloseSession ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(validateAndResetToken = true) ActionForward cancel(ActionMapping mapping, ActionForm form, @SuppressWarnings("unused") HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(conditionToken = true) ActionForward loadSearch(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @Override @TransactionDemarcate(joinToken = true) ActionForward search(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward validate(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request,
            @SuppressWarnings("unused") HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward captureQuestionResponses(
            final ActionMapping mapping, final ActionForm form, final HttpServletRequest request,
            @SuppressWarnings("unused") final HttpServletResponse response); @TransactionDemarcate(joinToken = true) ActionForward editQuestionResponses(
            final ActionMapping mapping, final ActionForm form,
            final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse response);  }
@Test public void shouldSetQuestionGroupInstanceDetailsInSession() throws PageExpiredException { List<QuestionGroupInstanceDetail> instanceDetails = asList(getQuestionGroupInstanceDetail("QG1"), getQuestionGroupInstanceDetail("QG2")); when(questionnaireServiceFacade.getQuestionGroupInstances(101, "View", "Group")).thenReturn(instanceDetails); when(request.getAttribute(Constants.CURRENTFLOWKEY)).thenReturn(FLOW_KEY); when(request.getSession()).thenReturn(session); when(session.getAttribute(Constants.FLOWMANAGER)).thenReturn(flowManager); Flow flow = new Flow(); when(flowManager.getFlowWithValidation(FLOW_KEY)).thenReturn(flow); groupCustAction.setQuestionGroupInstances(questionnaireServiceFacade, request, 101); assertThat((List<QuestionGroupInstanceDetail>) flow.getObjectFromSession("questionGroupInstances"), is(instanceDetails)); verify(questionnaireServiceFacade, times(1)).getQuestionGroupInstances(101, "View", "Group"); verify(request, times(1)).getAttribute(Constants.CURRENTFLOWKEY); verify(request, times(1)).getSession(); verify(session, times(1)).getAttribute(Constants.FLOWMANAGER); }