@Test public void testCreateQuestionSuccess() throws Exception { QuestionForm questionForm = getQuestionForm(TITLE, "date"); String result = questionController.createQuestions(questionForm, requestContext); Assert.assertThat(result, is("success")); Mockito.verify(questionnaireServiceFacade).createQuestions(anyListOf(QuestionDetail.class)); }
public String createQuestions(QuestionForm questionForm, RequestContext requestContext) { String result = "success"; try { questionnaireServiceFacade.createQuestions(getQuestionDetails(questionForm)); } catch (SystemException e) { constructAndLogSystemError(requestContext.getMessageContext(), e); result = "failure"; } return result; }
QuestionController extends QuestionnaireController { public String createQuestions(QuestionForm questionForm, RequestContext requestContext) { String result = "success"; try { questionnaireServiceFacade.createQuestions(getQuestionDetails(questionForm)); } catch (SystemException e) { constructAndLogSystemError(requestContext.getMessageContext(), e); result = "failure"; } return result; } }
QuestionController extends QuestionnaireController { public String createQuestions(QuestionForm questionForm, RequestContext requestContext) { String result = "success"; try { questionnaireServiceFacade.createQuestions(getQuestionDetails(questionForm)); } catch (SystemException e) { constructAndLogSystemError(requestContext.getMessageContext(), e); result = "failure"; } return result; } @SuppressWarnings({"UnusedDeclaration"})  QuestionController();  QuestionController(QuestionnaireServiceFacade questionnaireServiceFacade); }
QuestionController extends QuestionnaireController { public String createQuestions(QuestionForm questionForm, RequestContext requestContext) { String result = "success"; try { questionnaireServiceFacade.createQuestions(getQuestionDetails(questionForm)); } catch (SystemException e) { constructAndLogSystemError(requestContext.getMessageContext(), e); result = "failure"; } return result; } @SuppressWarnings({"UnusedDeclaration"})  QuestionController();  QuestionController(QuestionnaireServiceFacade questionnaireServiceFacade); @RequestMapping("/viewQuestions.ftl") String getAllQuestions(ModelMap model); String addQuestion(QuestionForm questionForm, RequestContext requestContext, boolean createMode); String addSmartChoiceTag(QuestionForm questionForm, RequestContext requestContext, int choiceIndex); void removeQuestion(QuestionForm questionForm, String questionTitle); String createQuestions(QuestionForm questionForm, RequestContext requestContext); }
QuestionController extends QuestionnaireController { public String createQuestions(QuestionForm questionForm, RequestContext requestContext) { String result = "success"; try { questionnaireServiceFacade.createQuestions(getQuestionDetails(questionForm)); } catch (SystemException e) { constructAndLogSystemError(requestContext.getMessageContext(), e); result = "failure"; } return result; } @SuppressWarnings({"UnusedDeclaration"})  QuestionController();  QuestionController(QuestionnaireServiceFacade questionnaireServiceFacade); @RequestMapping("/viewQuestions.ftl") String getAllQuestions(ModelMap model); String addQuestion(QuestionForm questionForm, RequestContext requestContext, boolean createMode); String addSmartChoiceTag(QuestionForm questionForm, RequestContext requestContext, int choiceIndex); void removeQuestion(QuestionForm questionForm, String questionTitle); String createQuestions(QuestionForm questionForm, RequestContext requestContext);  }