@Test public void helloTest() throws Exception { mockMvc.perform(get("/hello-template")) .andExpect(status().isOk()) .andExpect(view().name("hello-templateEngine")) .andDo(print()) .andExpect(model().attribute("name", "siyoon")); }
@GetMapping("/hello-template") public String hello(Model model) { model.addAttribute("name", "siyoon"); return "hello-templateEngine"; }
SampleController { @GetMapping("/hello-template") public String hello(Model model) { model.addAttribute("name", "siyoon"); return "hello-templateEngine"; } }
SampleController { @GetMapping("/hello-template") public String hello(Model model) { model.addAttribute("name", "siyoon"); return "hello-templateEngine"; }  }
SampleController { @GetMapping("/hello-template") public String hello(Model model) { model.addAttribute("name", "siyoon"); return "hello-templateEngine"; }  @GetMapping("/hello-template") String hello(Model model); }
SampleController { @GetMapping("/hello-template") public String hello(Model model) { model.addAttribute("name", "siyoon"); return "hello-templateEngine"; }  @GetMapping("/hello-template") String hello(Model model);  }