ConfigurableModule implements Module { @Override public List<Class<?>> getDefaultResources() { if (this.defaultResources != null) { return ListX.fromIterable((concat(this.defaultResources, extract(() -> Module.super.getDefaultResources())))); } return Module.super.getDefaultResources(); }  ConfigurableModule withResourceConfigManager(Consumer<JaxRsProvider<T>> resourceConfigManager); ConfigurableModule withServerConfigManager(Consumer<WebServerProvider<?>> serverConfigManager); @Override Set<Object> getJaxRsResourceObjects(); @Override Consumer<WebServerProvider<T>> getServerConfigManager(); @Override Consumer<JaxRsProvider<T>> getResourceConfigManager(); @Override List<String> getDefaultJaxRsPackages(); @Override Set<Class<?>> getRestResourceClasses(); @Override Set<Class<? extends Annotation>> getRestAnnotationClasses(); @Override List<Class<?>> getDefaultResources(); @Override List<ServletContextListener> getListeners(ServerData data); @Override List<ServletRequestListener> getRequestListeners(ServerData data); @Override Map<String, Filter> getFilters(ServerData data); @Override Map<String, Servlet> getServlets(ServerData data); @Override String getJaxWsRsApplication(); @Override String getProviders(); @Override String getContext(); @Override Set<Class<?>> getSpringConfigurationClasses(); @Override Map<String, Object> getServerProperties();  }
@Test public void defaultResourcesDefault(){ Module m = ConfigurableModule.builder().build(); assertThat(m.getDefaultResources().size(),equalTo(0)); }
@Test public void defaultResourcesNew(){ Module m = ConfigurableModule.builder().defaultResources(Arrays.asList(this.getClass())).build(); assertThat(m.getDefaultResources().size(),equalTo(1)); }
@Test public void testGetDefaultResourcesReset() { assertThat(module.withResetAll(true).getDefaultResources(),is(this.defaultResources)); }
@Test public void testGetDefaultResources() { assertThat(module.getDefaultResources().size(),is(0)); }
@Test public void testGetDefaultResourcesUnchanged() { assertThat(unchanged.getDefaultResources(),is(m.getDefaultResources())); }
@Test public void testWithDefaultResources() { assertThat(unchanged.withDefaultResources(this.defaultResources).getDefaultResources(),is(module.getDefaultResources())); }