@Test public void postHandleWithModelAndView() throws Exception { CoffeeNetNavigationInformation coffeeNetNavigationInformation = new CoffeeNetNavigationInformation(null, null, null, null, null); when(coffeeNetNavigationServiceMock.get()).thenReturn(coffeeNetNavigationInformation); ModelAndView modelAndView = new ModelAndView(); sut.postHandle(null, null, null, modelAndView); assertThat(modelAndView.getModelMap().containsKey("coffeenet")).isEqualTo(true); CoffeeNetNavigationInformation coffeenet = (CoffeeNetNavigationInformation) modelAndView .getModelMap().get("coffeenet"); Assertions.assertThat(coffeenet).isEqualTo(coffeeNetNavigationInformation); }
@Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) { if (modelAndView == null) { LOGGER.debug(" return; } String view = ofNullable(modelAndView.getViewName()).orElse(""); boolean isNotRedirect = !view.contains("redirect:"); if (isNotRedirect) { modelAndView.addObject("coffeenet", coffeeNetNavigationService.get()); LOGGER.debug(" } else { LOGGER.debug(" } }
CoffeeNetNavigationInterceptor extends HandlerInterceptorAdapter { @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) { if (modelAndView == null) { LOGGER.debug(" return; } String view = ofNullable(modelAndView.getViewName()).orElse(""); boolean isNotRedirect = !view.contains("redirect:"); if (isNotRedirect) { modelAndView.addObject("coffeenet", coffeeNetNavigationService.get()); LOGGER.debug(" } else { LOGGER.debug(" } } }
CoffeeNetNavigationInterceptor extends HandlerInterceptorAdapter { @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) { if (modelAndView == null) { LOGGER.debug(" return; } String view = ofNullable(modelAndView.getViewName()).orElse(""); boolean isNotRedirect = !view.contains("redirect:"); if (isNotRedirect) { modelAndView.addObject("coffeenet", coffeeNetNavigationService.get()); LOGGER.debug(" } else { LOGGER.debug(" } } CoffeeNetNavigationInterceptor(CoffeeNetNavigationService coffeeNetNavigationService); }
CoffeeNetNavigationInterceptor extends HandlerInterceptorAdapter { @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) { if (modelAndView == null) { LOGGER.debug(" return; } String view = ofNullable(modelAndView.getViewName()).orElse(""); boolean isNotRedirect = !view.contains("redirect:"); if (isNotRedirect) { modelAndView.addObject("coffeenet", coffeeNetNavigationService.get()); LOGGER.debug(" } else { LOGGER.debug(" } } CoffeeNetNavigationInterceptor(CoffeeNetNavigationService coffeeNetNavigationService); @Override void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
        ModelAndView modelAndView); }
CoffeeNetNavigationInterceptor extends HandlerInterceptorAdapter { @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) { if (modelAndView == null) { LOGGER.debug(" return; } String view = ofNullable(modelAndView.getViewName()).orElse(""); boolean isNotRedirect = !view.contains("redirect:"); if (isNotRedirect) { modelAndView.addObject("coffeenet", coffeeNetNavigationService.get()); LOGGER.debug(" } else { LOGGER.debug(" } } CoffeeNetNavigationInterceptor(CoffeeNetNavigationService coffeeNetNavigationService); @Override void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
        ModelAndView modelAndView);  }