PerformanceFilter extends OncePerRequestFilter implements Filter { @Override public void initFilterBean() throws ServletException { this.threshold = FilterConfigUtils.getIntParameter(getFilterConfig(), "threshold", threshold); this.includeQueryString = FilterConfigUtils.getBooleanParameter(getFilterConfig(), "includeQueryString", includeQueryString); log.info("PerformanceFilter started with threshold:"+threshold+"ms includeQueryString:"+includeQueryString); }  void destroy(); @Override void initFilterBean();  }
@Test public void test_initFilterBean() throws Throwable{ performanceFilter.init(filterConfig); performanceFilter.initFilterBean(); Assert.assertEquals(performanceFilter.threshold,3000); Assert.assertEquals(performanceFilter.includeQueryString,false); filterConfig.addInitParameter("threshold", ""+5000); filterConfig.addInitParameter("includeQueryString", "true"); performanceFilter.init(filterConfig); performanceFilter.initFilterBean(); Assert.assertEquals(performanceFilter.threshold,5000); Assert.assertEquals(performanceFilter.includeQueryString,true); }