@Test public void testInit() throws Exception { mockMvc .perform(get(SettingsController.URI)) .andExpect(status().isOk()) .andExpect(view().name(SettingsController.VIEW_TEMPLATE)) .andExpect(model().attribute("baseUrl", "/test/path")); }
@GetMapping("/**") public String init(Model model) { model.addAttribute(KEY_BASE_URL, menuReaderService.findMenuItemPath(ID)); return VIEW_TEMPLATE; }
SettingsController extends PluginController { @GetMapping("/**") public String init(Model model) { model.addAttribute(KEY_BASE_URL, menuReaderService.findMenuItemPath(ID)); return VIEW_TEMPLATE; } }
SettingsController extends PluginController { @GetMapping("/**") public String init(Model model) { model.addAttribute(KEY_BASE_URL, menuReaderService.findMenuItemPath(ID)); return VIEW_TEMPLATE; } SettingsController(MenuReaderService menuReaderService); }
SettingsController extends PluginController { @GetMapping("/**") public String init(Model model) { model.addAttribute(KEY_BASE_URL, menuReaderService.findMenuItemPath(ID)); return VIEW_TEMPLATE; } SettingsController(MenuReaderService menuReaderService); @GetMapping("/**") String init(Model model); }
SettingsController extends PluginController { @GetMapping("/**") public String init(Model model) { model.addAttribute(KEY_BASE_URL, menuReaderService.findMenuItemPath(ID)); return VIEW_TEMPLATE; } SettingsController(MenuReaderService menuReaderService); @GetMapping("/**") String init(Model model); static final String ID; static final String URI; static final String VIEW_TEMPLATE; }