### Question:
ComponentInterceptor 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) { Component component = componentService.getComponentOfForum(); modelAndView.addObject(FORUM_COMPONENT_MODEL_PARAM, component); } } ComponentInterceptor(ComponentService componentService); @Override void postHandle(
            HttpServletRequest request,
            HttpServletResponse response,
            Object handler,
            ModelAndView modelAndView);  }### Answer:
@Test public void postHandleshouldAddComponentToEveryViewPage() throws Exception { ModelAndView modelAndView = new ModelAndView("a view"); componentInterceptor.postHandle(null, null, null, modelAndView); assertModelAttributeAvailable(modelAndView, ComponentInterceptor.FORUM_COMPONENT_MODEL_PARAM); }
@Test public void postHandleShouldNotAddDataForBannersWhenModelIsNull() throws Exception { componentInterceptor.postHandle(null, null, null, null); }