ServletContainerInitializerExtension implements WebApplicationExtension { @Override public void configure(WebApplication webApplication) { LOGGER.log(FINER, "Starting ServletContainerInitializer processing"); ServiceLoader<ServletContainerInitializer> serviceLoader = ServiceLoader.load( ServletContainerInitializer.class, webApplication.getClassLoader()); for (ServletContainerInitializer initializer : serviceLoader) { LOGGER.log(FINE, () -> "Adding initializer: " + initializer.getClass().getName()); if (shouldAdd(webApplication, initializer)) { webApplication.addInitializer(initializer); } } if (this.getClass().getModule().isNamed()) { serviceLoader = ServiceLoader.load(ServletContainerInitializer.class); for (ServletContainerInitializer initializer : serviceLoader) { LOGGER.log(FINE, () -> "Adding initializer: " + initializer.getClass().getName()); if (shouldAdd(webApplication, initializer)) { webApplication.addInitializer(initializer); } } } LOGGER.log(FINER, "Finished ServletContainerInitializer processing"); } ServletContainerInitializerExtension();  ServletContainerInitializerExtension(boolean excludeExistingInitializers, List<String> ignoreInitializers); @Override void configure(WebApplication webApplication);  }
@Test void testConfigure() { DefaultWebApplication webApplication = new DefaultWebApplication(); ServletContainerInitializerExtension extension = new ServletContainerInitializerExtension(); extension.configure(webApplication); }