@Test public void discoversModelsFromClasspath() { URL[] urls = new URL[]{getClass().getResource("jar-import.jar")}; URLClassLoader classLoader = new URLClassLoader(urls); List<URL> models = ModelDiscovery.findModels(classLoader); List<String> names = models.stream() .map(ModelDiscovery::getSmithyModelPathFromJarUrl) .collect(Collectors.toList()); assertThat(names, contains("a.smithy", "b/b.smithy", "b/c/c.json")); }
public static List<URL> findModels() { return findModels(Thread.currentThread().getContextClassLoader()); }
ModelDiscovery { public static List<URL> findModels() { return findModels(Thread.currentThread().getContextClassLoader()); } }
ModelDiscovery { public static List<URL> findModels() { return findModels(Thread.currentThread().getContextClassLoader()); } private  ModelDiscovery(); }
ModelDiscovery { public static List<URL> findModels() { return findModels(Thread.currentThread().getContextClassLoader()); } private  ModelDiscovery(); static List<URL> findModels(); static List<URL> findModels(ClassLoader loader); static List<URL> findModels(URL jarManifestUrl); static String getSmithyModelPathFromJarUrl(URL modelUrl); static URL createSmithyJarManifestUrl(String fileOrUrl); }
ModelDiscovery { public static List<URL> findModels() { return findModels(Thread.currentThread().getContextClassLoader()); } private  ModelDiscovery(); static List<URL> findModels(); static List<URL> findModels(ClassLoader loader); static List<URL> findModels(URL jarManifestUrl); static String getSmithyModelPathFromJarUrl(URL modelUrl); static URL createSmithyJarManifestUrl(String fileOrUrl);  }