@Test void testGetQuestionnaireSubmissionText() throws Exception { when(questionnaireService.getQuestionnaireSubmissionText("1")).thenReturn("thanks!"); MvcResult result = mockMvc .perform(get(QuestionnaireController.URI + "/submission-text/1")) .andExpect(status().isOk()) .andReturn(); String actual = result.getResponse().getContentAsString(); String expected = "\"thanks!\""; assertEquals(expected, actual); }
@ResponseBody @GetMapping("/submission-text/{id}") @SuppressWarnings("javasecurity:S5131") public String getQuestionnaireSubmissionText(@PathVariable("id") String id) { return questionnaireService.getQuestionnaireSubmissionText(id); }
QuestionnaireController extends PluginController { @ResponseBody @GetMapping("/submission-text/{id}") @SuppressWarnings("javasecurity:S5131") public String getQuestionnaireSubmissionText(@PathVariable("id") String id) { return questionnaireService.getQuestionnaireSubmissionText(id); } }
QuestionnaireController extends PluginController { @ResponseBody @GetMapping("/submission-text/{id}") @SuppressWarnings("javasecurity:S5131") public String getQuestionnaireSubmissionText(@PathVariable("id") String id) { return questionnaireService.getQuestionnaireSubmissionText(id); } QuestionnaireController(
      QuestionnaireService questionnaireService,
      MenuReaderService menuReaderService,
      AppSettings appSettings,
      UserAccountService userAccountService); }
QuestionnaireController extends PluginController { @ResponseBody @GetMapping("/submission-text/{id}") @SuppressWarnings("javasecurity:S5131") public String getQuestionnaireSubmissionText(@PathVariable("id") String id) { return questionnaireService.getQuestionnaireSubmissionText(id); } QuestionnaireController(
      QuestionnaireService questionnaireService,
      MenuReaderService menuReaderService,
      AppSettings appSettings,
      UserAccountService userAccountService); @GetMapping("/**") String initView(Model model); @ResponseBody @GetMapping(value = "/list") List<QuestionnaireResponse> getQuestionnaires(); @GetMapping(value = "/start/{id}") @ResponseBody QuestionnaireResponse startQuestionnaire(@PathVariable("id") String id); @ResponseBody @GetMapping("/submission-text/{id}") @SuppressWarnings("javasecurity:S5131") // id is validated in questionnaireService String getQuestionnaireSubmissionText(@PathVariable("id") String id); }
QuestionnaireController extends PluginController { @ResponseBody @GetMapping("/submission-text/{id}") @SuppressWarnings("javasecurity:S5131") public String getQuestionnaireSubmissionText(@PathVariable("id") String id) { return questionnaireService.getQuestionnaireSubmissionText(id); } QuestionnaireController(
      QuestionnaireService questionnaireService,
      MenuReaderService menuReaderService,
      AppSettings appSettings,
      UserAccountService userAccountService); @GetMapping("/**") String initView(Model model); @ResponseBody @GetMapping(value = "/list") List<QuestionnaireResponse> getQuestionnaires(); @GetMapping(value = "/start/{id}") @ResponseBody QuestionnaireResponse startQuestionnaire(@PathVariable("id") String id); @ResponseBody @GetMapping("/submission-text/{id}") @SuppressWarnings("javasecurity:S5131") // id is validated in questionnaireService String getQuestionnaireSubmissionText(@PathVariable("id") String id); static final String ID; static final String URI; }