Spring Framework CompositePropertySource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework CompositePropertySource class.

This code example shows how to use the following methods:addPropertySource
						.getEurekaServerServiceUrls("defaultZone").toString()); 
	} 
 
	@Test
	public void serviceUrlWithCompositePropertySource() { 
		CompositePropertySource source = new CompositePropertySource("composite");
		context.getEnvironment().getPropertySources().addFirst(source);
		source.addPropertySource(new MapPropertySource("config", Collections
				.<String, Object> singletonMap("eureka.client.serviceUrl.defaultZone",
						"http://example.com"))); 
		context.register(PropertyPlaceholderAutoConfiguration.class,
				TestConfiguration.class); 
		context.refresh();
		assertEquals("{defaultZone=http://example.com}", 
				context.getBean(EurekaClientConfigBean.class).getServiceUrl().toString());
		assertEquals( 
				"[http://example.com]", 
				context.getBean(EurekaClientConfigBean.class)
						.getEurekaServerServiceUrls("defaultZone").toString()); 
	} 
5
CodeRank
See Code Examples for Spring Framework CompositePropertySource Methods: