QuestionController extends QuestionnaireController { @RequestMapping("/viewQuestions.ftl") public String getAllQuestions(ModelMap model) { model.addAttribute("questions", questionnaireServiceFacade.getAllQuestions()); return "viewQuestions"; } @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);  }
@Test public void shouldGetAllQuestions() { List<QuestionDetail> questionDetailList = Arrays.asList(getQuestionDetail(1, "title1", QuestionType.NUMERIC), getQuestionDetail(2, "title2", QuestionType.NUMERIC)); when(questionnaireServiceFacade.getAllQuestions()).thenReturn(questionDetailList); String view = questionController.getAllQuestions(model); Assert.assertThat(view, is("viewQuestions")); Mockito.verify(questionnaireServiceFacade).getAllQuestions(); Mockito.verify(model).addAttribute(Mockito.eq("questions"), Mockito.eq(questionDetailList)); }