ServletContainerInitializerRegistrationBean implements WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> { protected Set<Class<?>> getClasses(ClassLoader classLoader) { return findPreparedScanResult(classLoader).orElseGet(this::performClasspathScan); }  @Override void customize(ConfigurableServletWebServerFactory factory);  }
@Test public void getClasses_null() { ServletContainerInitializerRegistrationBean<NoHandlesTypes> bean = new ServletContainerInitializerRegistrationBean<>(NoHandlesTypes.class); assertThat(bean.getClasses(getClass().getClassLoader())).isNull(); }
@Test public void getClasses_empty() { ServletContainerInitializerRegistrationBean<EmptyHandlesTypes> bean = new ServletContainerInitializerRegistrationBean<>(EmptyHandlesTypes.class); assertThat(bean.getClasses(getClass().getClassLoader())).isNull(); }
@Test public void testMojarra() { ServletContainerInitializerRegistrationBean<FacesInitializer> bean = new ServletContainerInitializerRegistrationBean<>(FacesInitializer.class); Set<Class<?>> classes = bean.getClasses(getClass().getClassLoader()); assertThat(classes).isNotEmpty(); assertThat(classes).contains(UIViewAction.class, MessageRenderer.class, InputNumberRenderer.class, DelegatingPhaseListenerMulticaster.class); }
@Test public void testMyfaces() { ServletContainerInitializerRegistrationBean<MyFacesContainerInitializer> bean = new ServletContainerInitializerRegistrationBean<>(MyFacesContainerInitializer.class); Set<Class<?>> classes = bean.getClasses(getClass().getClassLoader()); assertThat(classes).isNotEmpty(); assertThat(classes).contains(UIViewAction.class, MessageRenderer.class, InputNumberRenderer.class); }