### Question:
BannerInterceptor extends HandlerInterceptorAdapter { @Override public void postHandle( HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { super.postHandle(request, response, handler, modelAndView); if (modelAndView != null) { Map<String, Banner> allBanersOfTheForum = bannerService.getAllBanners(); modelAndView.addObject("banners", allBanersOfTheForum); modelAndView.addObject("uploadedBanner", new Banner()); } } BannerInterceptor(BannerService bannerService); @Override void postHandle(
            HttpServletRequest request,
            HttpServletResponse response,
            Object handler,
            ModelAndView modelAndView);  }### Answer:
@Test public void postHandleShouldAddDataForBanners() throws Exception { ModelAndView modelAndView = new ModelAndView("a view"); bannerInterceptor.postHandle(null, null, null, modelAndView); assertModelAttributeAvailable(modelAndView, BannerInterceptor.BANNERS_MODEL_PARAM); assertModelAttributeAvailable(modelAndView, BannerInterceptor.UPLOADED_BANNER_MODEL_PARAM); }
@Test public void postHandleShouldNotAddDataForBannersWhenModelIsNull() throws Exception { bannerInterceptor.postHandle(null, null, null, null); }