@Test public void testReloadConfigRedirectsToApplicationRoot() throws Exception { controller.reloadConfig(response); verify(response, times(1)).sendRedirect(FindController.APP_PATH); }
@RequestMapping(CONFIG_RELOAD_PATH) public void reloadConfig(final HttpServletResponse response) throws Exception { for(final ReloadableCustomizationComponent component : reloadableCustomizationComponents) { log.info("Reloading customization component: " + component.getClass().getSimpleName()); component.reload(); } final List<String> pathElements = Stream.of( (contextPath + FindController.APP_PATH).split("/") ).filter(s -> !s.isEmpty()).collect(Collectors.toList()); final String redirect = "/" + String.join("/", pathElements); response.sendRedirect(redirect); }
CustomizationReloadController { @RequestMapping(CONFIG_RELOAD_PATH) public void reloadConfig(final HttpServletResponse response) throws Exception { for(final ReloadableCustomizationComponent component : reloadableCustomizationComponents) { log.info("Reloading customization component: " + component.getClass().getSimpleName()); component.reload(); } final List<String> pathElements = Stream.of( (contextPath + FindController.APP_PATH).split("/") ).filter(s -> !s.isEmpty()).collect(Collectors.toList()); final String redirect = "/" + String.join("/", pathElements); response.sendRedirect(redirect); } }
CustomizationReloadController { @RequestMapping(CONFIG_RELOAD_PATH) public void reloadConfig(final HttpServletResponse response) throws Exception { for(final ReloadableCustomizationComponent component : reloadableCustomizationComponents) { log.info("Reloading customization component: " + component.getClass().getSimpleName()); component.reload(); } final List<String> pathElements = Stream.of( (contextPath + FindController.APP_PATH).split("/") ).filter(s -> !s.isEmpty()).collect(Collectors.toList()); final String redirect = "/" + String.join("/", pathElements); response.sendRedirect(redirect); } @Autowired  CustomizationReloadController(
        @Value(AppConfiguration.SERVER_CONTEXT_PATH) String contextPath,
        final Collection<ReloadableCustomizationComponent> reloadableCustomizationComponents,
        final ControllerUtils controllerUtils); }
CustomizationReloadController { @RequestMapping(CONFIG_RELOAD_PATH) public void reloadConfig(final HttpServletResponse response) throws Exception { for(final ReloadableCustomizationComponent component : reloadableCustomizationComponents) { log.info("Reloading customization component: " + component.getClass().getSimpleName()); component.reload(); } final List<String> pathElements = Stream.of( (contextPath + FindController.APP_PATH).split("/") ).filter(s -> !s.isEmpty()).collect(Collectors.toList()); final String redirect = "/" + String.join("/", pathElements); response.sendRedirect(redirect); } @Autowired  CustomizationReloadController(
        @Value(AppConfiguration.SERVER_CONTEXT_PATH) String contextPath,
        final Collection<ReloadableCustomizationComponent> reloadableCustomizationComponents,
        final ControllerUtils controllerUtils); @RequestMapping(CONFIG_RELOAD_PATH) void reloadConfig(final HttpServletResponse response); @ExceptionHandler(Exception.class) ModelAndView errorHandler(
        final HttpServletRequest request,
        final Exception e); }
CustomizationReloadController { @RequestMapping(CONFIG_RELOAD_PATH) public void reloadConfig(final HttpServletResponse response) throws Exception { for(final ReloadableCustomizationComponent component : reloadableCustomizationComponents) { log.info("Reloading customization component: " + component.getClass().getSimpleName()); component.reload(); } final List<String> pathElements = Stream.of( (contextPath + FindController.APP_PATH).split("/") ).filter(s -> !s.isEmpty()).collect(Collectors.toList()); final String redirect = "/" + String.join("/", pathElements); response.sendRedirect(redirect); } @Autowired  CustomizationReloadController(
        @Value(AppConfiguration.SERVER_CONTEXT_PATH) String contextPath,
        final Collection<ReloadableCustomizationComponent> reloadableCustomizationComponents,
        final ControllerUtils controllerUtils); @RequestMapping(CONFIG_RELOAD_PATH) void reloadConfig(final HttpServletResponse response); @ExceptionHandler(Exception.class) ModelAndView errorHandler(
        final HttpServletRequest request,
        final Exception e); final static String ADMIN_CUSTOMIZATION_PATH; final static String CONFIG_RELOAD_PATH; }