ProfileUtil { public static ProcessorConfig blendProfileWithConfiguration(ProcessorConfigurationExtractor configExtractor, String profile, File resourceDir, ProcessorConfig config) throws IOException { ProcessorConfig profileConfig = extractProcesssorConfiguration(configExtractor, profile, resourceDir); return ProcessorConfig.mergeProcessorConfigs(config, profileConfig); } 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 blendProfiles() throws Exception { ProcessorConfig origConfig = new ProcessorConfig(Arrays.asList("i1", "i2"), Collections.singleton("spring.swarm"), null); ProcessorConfig mergeConfig = ProfileUtil.blendProfileWithConfiguration(ProfileUtil.ENRICHER_CONFIG, "simple", getProfileDir(), origConfig); assertTrue(mergeConfig.use("base")); assertTrue(mergeConfig.use("i1")); assertEquals(mergeConfig.getConfig("base", "url"),"http: mergeConfig = ProfileUtil.blendProfileWithConfiguration(ProfileUtil.GENERATOR_CONFIG, "simple", getProfileDir(), origConfig); assertTrue(mergeConfig.use("i2")); assertFalse(mergeConfig.use("spring.swarm")); }