ProfileUtil { public static List<Profile> readAllFromClasspath(String name, String ext) throws IOException { List<Profile > ret = new ArrayList<>(); for (String location : getMetaInfProfilePaths(ext)) { for (String url : ClassUtil.getResources(location)) { for (Profile profile : fromYaml(new URL(url).openStream())) { if (name.equals(profile.getName())) { ret.add(profile); } } } } return ret; } private  ProfileUtil(); static Profile findProfile(String profileArg, File resourceDir); static ProcessorConfig blendProfileWithConfiguration(ProcessorConfigurationExtractor configExtractor,
                                                                String profile,
                                                                File resourceDir,
                                                                ProcessorConfig config); static Profile lookup(String name, File directory); static List<Profile> readAllFromClasspath(String name, String ext); static List<Profile> fromYaml(InputStream is); static final String[] PROFILE_FILENAMES; static final String DEFAULT_PROFILE; final static ProcessorConfigurationExtractor GENERATOR_CONFIG; final static ProcessorConfigurationExtractor ENRICHER_CONFIG; final static ProcessorConfigurationExtractor WATCHER_CONFIG; }
@Test public void fromClasspath() throws IOException { List<Profile> profiles = ProfileUtil.readAllFromClasspath("one", ""); assertEquals(1, profiles.size()); assertNotNull(profiles.get(0)); }