@Test void testInit() throws Exception { mockMvc .perform(get(DataRowEditController.URI)) .andExpect(status().isOk()) .andExpect(view().name(DataRowEditController.VIEW_TEMPLATE)) .andExpect(model().attribute("baseUrl", "/plugin/data-row-edit")) .andExpect(model().attribute("lng", "en")) .andExpect(model().attribute("fallbackLng", "DDEEFF")); }
@GetMapping("/**") public String init(Model model) { model.addAttribute("baseUrl", URI); model.addAttribute("lng", LocaleContextHolder.getLocale().getLanguage()); model.addAttribute("fallbackLng", appSettings.getLanguageCode()); model.addAttribute( "dataExplorerBaseUrl", menuReaderService.findMenuItemPath(DataExplorerController.ID)); return VIEW_TEMPLATE; }
DataRowEditController extends PluginController { @GetMapping("/**") public String init(Model model) { model.addAttribute("baseUrl", URI); model.addAttribute("lng", LocaleContextHolder.getLocale().getLanguage()); model.addAttribute("fallbackLng", appSettings.getLanguageCode()); model.addAttribute( "dataExplorerBaseUrl", menuReaderService.findMenuItemPath(DataExplorerController.ID)); return VIEW_TEMPLATE; } }
DataRowEditController extends PluginController { @GetMapping("/**") public String init(Model model) { model.addAttribute("baseUrl", URI); model.addAttribute("lng", LocaleContextHolder.getLocale().getLanguage()); model.addAttribute("fallbackLng", appSettings.getLanguageCode()); model.addAttribute( "dataExplorerBaseUrl", menuReaderService.findMenuItemPath(DataExplorerController.ID)); return VIEW_TEMPLATE; } DataRowEditController(MenuReaderService menuReaderService, AppSettings appSettings); }
DataRowEditController extends PluginController { @GetMapping("/**") public String init(Model model) { model.addAttribute("baseUrl", URI); model.addAttribute("lng", LocaleContextHolder.getLocale().getLanguage()); model.addAttribute("fallbackLng", appSettings.getLanguageCode()); model.addAttribute( "dataExplorerBaseUrl", menuReaderService.findMenuItemPath(DataExplorerController.ID)); return VIEW_TEMPLATE; } DataRowEditController(MenuReaderService menuReaderService, AppSettings appSettings); @GetMapping("/**") String init(Model model); }
DataRowEditController extends PluginController { @GetMapping("/**") public String init(Model model) { model.addAttribute("baseUrl", URI); model.addAttribute("lng", LocaleContextHolder.getLocale().getLanguage()); model.addAttribute("fallbackLng", appSettings.getLanguageCode()); model.addAttribute( "dataExplorerBaseUrl", menuReaderService.findMenuItemPath(DataExplorerController.ID)); return VIEW_TEMPLATE; } DataRowEditController(MenuReaderService menuReaderService, AppSettings appSettings); @GetMapping("/**") String init(Model model); static final String ID; static final String URI; static final String VIEW_TEMPLATE; }