@Test public void showJudgmentDetails() throws Exception { ResultActions actions = mockMvc.perform(get("/judgments/" + judgment.getId())); actions .andExpect(status().isOk()) .andExpect(view().name("judgmentDetails")) .andExpect(model().attribute("judgment", judgment)) .andExpect(model().attribute("formattedTextContent", "aaa<br />bbb")) .andExpect(model().attribute("corrections", judgmentCorrections)); verify(judgmentEnrichmentService).findOneAndEnrich(judgment.getId()); verify(judgmentCorrectionService).findAllByJudgmentIdSorted(judgment.getId()); }
@RequestMapping("/judgments/{judgmentId}") public String showJudgmentDetails(ModelMap model, @PathVariable("judgmentId") long judgmentId) { Judgment judgment = judgmentEnrichmentService.findOneAndEnrich(judgmentId); String formattedTextContent = judgment.getRawTextContent(); if (judgment.getTextContent().getType() != ContentType.HTML) { formattedTextContent = formattedTextContent.replaceAll("\\n", "<br />"); } model.addAttribute("judgment", judgment); model.addAttribute("corrections", judgmentCorrectionService.findAllByJudgmentIdSorted(judgmentId)); model.addAttribute("formattedTextContent", formattedTextContent); model.addAttribute("referencingCount", referencingJudgmentsService.fetchReferencingJudgmentsCount(judgment.getId())); return "judgmentDetails"; }
JudgmentDetailsController { @RequestMapping("/judgments/{judgmentId}") public String showJudgmentDetails(ModelMap model, @PathVariable("judgmentId") long judgmentId) { Judgment judgment = judgmentEnrichmentService.findOneAndEnrich(judgmentId); String formattedTextContent = judgment.getRawTextContent(); if (judgment.getTextContent().getType() != ContentType.HTML) { formattedTextContent = formattedTextContent.replaceAll("\\n", "<br />"); } model.addAttribute("judgment", judgment); model.addAttribute("corrections", judgmentCorrectionService.findAllByJudgmentIdSorted(judgmentId)); model.addAttribute("formattedTextContent", formattedTextContent); model.addAttribute("referencingCount", referencingJudgmentsService.fetchReferencingJudgmentsCount(judgment.getId())); return "judgmentDetails"; } }
JudgmentDetailsController { @RequestMapping("/judgments/{judgmentId}") public String showJudgmentDetails(ModelMap model, @PathVariable("judgmentId") long judgmentId) { Judgment judgment = judgmentEnrichmentService.findOneAndEnrich(judgmentId); String formattedTextContent = judgment.getRawTextContent(); if (judgment.getTextContent().getType() != ContentType.HTML) { formattedTextContent = formattedTextContent.replaceAll("\\n", "<br />"); } model.addAttribute("judgment", judgment); model.addAttribute("corrections", judgmentCorrectionService.findAllByJudgmentIdSorted(judgmentId)); model.addAttribute("formattedTextContent", formattedTextContent); model.addAttribute("referencingCount", referencingJudgmentsService.fetchReferencingJudgmentsCount(judgment.getId())); return "judgmentDetails"; }  }
JudgmentDetailsController { @RequestMapping("/judgments/{judgmentId}") public String showJudgmentDetails(ModelMap model, @PathVariable("judgmentId") long judgmentId) { Judgment judgment = judgmentEnrichmentService.findOneAndEnrich(judgmentId); String formattedTextContent = judgment.getRawTextContent(); if (judgment.getTextContent().getType() != ContentType.HTML) { formattedTextContent = formattedTextContent.replaceAll("\\n", "<br />"); } model.addAttribute("judgment", judgment); model.addAttribute("corrections", judgmentCorrectionService.findAllByJudgmentIdSorted(judgmentId)); model.addAttribute("formattedTextContent", formattedTextContent); model.addAttribute("referencingCount", referencingJudgmentsService.fetchReferencingJudgmentsCount(judgment.getId())); return "judgmentDetails"; }  @RequestMapping("/judgments/{judgmentId}") String showJudgmentDetails(ModelMap model, @PathVariable("judgmentId") long judgmentId); }
JudgmentDetailsController { @RequestMapping("/judgments/{judgmentId}") public String showJudgmentDetails(ModelMap model, @PathVariable("judgmentId") long judgmentId) { Judgment judgment = judgmentEnrichmentService.findOneAndEnrich(judgmentId); String formattedTextContent = judgment.getRawTextContent(); if (judgment.getTextContent().getType() != ContentType.HTML) { formattedTextContent = formattedTextContent.replaceAll("\\n", "<br />"); } model.addAttribute("judgment", judgment); model.addAttribute("corrections", judgmentCorrectionService.findAllByJudgmentIdSorted(judgmentId)); model.addAttribute("formattedTextContent", formattedTextContent); model.addAttribute("referencingCount", referencingJudgmentsService.fetchReferencingJudgmentsCount(judgment.getId())); return "judgmentDetails"; }  @RequestMapping("/judgments/{judgmentId}") String showJudgmentDetails(ModelMap model, @PathVariable("judgmentId") long judgmentId);  }