WarInitializer implements WebApplicationInitializer { @Override public void onStartup(ServletContext servletContext) throws ServletException { initContextLoaderListener(servletContext); initDispatchServlet(servletContext); initDelegatingFilterProxy(servletContext); initLog4JMdcLoggingFilter(servletContext); initCharacterEncodingFilter(servletContext); initRequestLoggingFilter(servletContext); initServletMapping(servletContext); }  @Override void onStartup(ServletContext servletContext);  }
@Test public void testOnStartup() throws Exception { WarInitializer warInitializer = new WarInitializer(); ServletContext servletContext = new ExtendedMockServletContext(); warInitializer.initDispatchServlet(servletContext); warInitializer.initDelegatingFilterProxy(servletContext); warInitializer.initLog4JMdcLoggingFilter(servletContext); warInitializer.initCharacterEncodingFilter(servletContext); warInitializer.initRequestLoggingFilter(servletContext); warInitializer.initServletMapping(servletContext); }