@Test public void testNoHttp() throws IOException, ServletException { final ServletRequest request = createNiceMock(ServletRequest.class); final ServletResponse response = createNiceMock(ServletResponse.class); final FilterChain chain = createNiceMock(FilterChain.class); replay(request); replay(response); replay(chain); pluginMonitoringFilter.doFilter(request, response, chain); verify(request); verify(response); verify(chain); }
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest)) { super.doFilter(request, response, chain); return; } final HttpServletRequest httpRequest = (HttpServletRequest) request; registerSessionIfNeeded(httpRequest); super.doFilter(request, response, chain); unregisterSessionIfNeeded(httpRequest); }
PluginMonitoringFilter extends MonitoringFilter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest)) { super.doFilter(request, response, chain); return; } final HttpServletRequest httpRequest = (HttpServletRequest) request; registerSessionIfNeeded(httpRequest); super.doFilter(request, response, chain); unregisterSessionIfNeeded(httpRequest); } }
PluginMonitoringFilter extends MonitoringFilter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest)) { super.doFilter(request, response, chain); return; } final HttpServletRequest httpRequest = (HttpServletRequest) request; registerSessionIfNeeded(httpRequest); super.doFilter(request, response, chain); unregisterSessionIfNeeded(httpRequest); }  }
PluginMonitoringFilter extends MonitoringFilter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest)) { super.doFilter(request, response, chain); return; } final HttpServletRequest httpRequest = (HttpServletRequest) request; registerSessionIfNeeded(httpRequest); super.doFilter(request, response, chain); unregisterSessionIfNeeded(httpRequest); }  @Override void init(FilterConfig config); @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); static void logForDebug(String msg); }
PluginMonitoringFilter extends MonitoringFilter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest)) { super.doFilter(request, response, chain); return; } final HttpServletRequest httpRequest = (HttpServletRequest) request; registerSessionIfNeeded(httpRequest); super.doFilter(request, response, chain); unregisterSessionIfNeeded(httpRequest); }  @Override void init(FilterConfig config); @Override void destroy(); @Override void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); static void logForDebug(String msg);  }